<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Alfresco 2.1 - web scripts - file upload in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/alfresco-2-1-web-scripts-file-upload/m-p/111540#M78437</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I assume you mean using Javascript API not using webscripts (WebScripts is a framework that brings together the existing Templating and Javascript APIs into a cohesive URL addressable framework). Anyway, the cm:content property can only be copied using the JavaScript API if it is a text node (not in your case), so you want something like this instead:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var node2 = node.copy(filename);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;node2.specializeType(typeofContent);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;will do what you want i think.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kevin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Jul 2007 15:16:13 GMT</pubDate>
    <dc:creator>kevinr</dc:creator>
    <dc:date>2007-07-23T15:16:13Z</dc:date>
    <item>
      <title>Alfresco 2.1 - web scripts - file upload</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/alfresco-2-1-web-scripts-file-upload/m-p/111535#M78432</link>
      <description>Hi all,I am trying to use Alfresco as a document storage engine for a Ruby on Rails app.Reading the Alfresco Blog I learned the best way to accomplish this is to use the new web scripts feature.I wrote a simple webscript to create a file, but&amp;nbsp; I have 2 questions:1) how do I actually upload the file</description>
      <pubDate>Fri, 06 Jul 2007 14:35:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/alfresco-2-1-web-scripts-file-upload/m-p/111535#M78432</guid>
      <dc:creator>lorty</dc:creator>
      <dc:date>2007-07-06T14:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: Alfresco 2.1 - web scripts - file upload</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/alfresco-2-1-web-scripts-file-upload/m-p/111536#M78433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;1) how do I actually upload the file content from a form? As soon as I use a multipart/form-data form, I am not able anymore to retrieve "args" from the webscript. Am I missing somethig obvious here?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Support for multipart/form-data is not there yet.&amp;nbsp; Also, we don't have an upload web script as we do a download web script.&amp;nbsp; The only escape route at this time, is to develop a java backing-bean to a web script, but that's hard work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is obviously a hole, and it's something I hope to fill by 2.1 final.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;2) how is authentication performed from webscripts? How can I authenticate from an external (Rails) app?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Authentication mechanisms may be plugged-in, but by default, Basic HTTP authentication is used.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2007 09:28:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/alfresco-2-1-web-scripts-file-upload/m-p/111536#M78433</guid>
      <dc:creator>davidc</dc:creator>
      <dc:date>2007-07-09T09:28:16Z</dc:date>
    </item>
    <item>
      <title>Re: Alfresco 2.1 - web scripts - file upload</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/alfresco-2-1-web-scripts-file-upload/m-p/111537#M78434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The best Idea i have, for uploading a file using webscript, is to use a external script that uploads the file to a mounted CIFS Alfresco File System. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem is that the type of this new node is cm:content by default. How can I put the node content type when I upload a file?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks so much! Best regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;–&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Santigt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2007 09:24:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/alfresco-2-1-web-scripts-file-upload/m-p/111537#M78434</guid>
      <dc:creator>santigt</dc:creator>
      <dc:date>2007-07-23T09:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Alfresco 2.1 - web scripts - file upload</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/alfresco-2-1-web-scripts-file-upload/m-p/111538#M78435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The problem is that the type of this new node is cm:content by default. How can I put the node content type when I upload a file?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Use the web-client to create a Rule on the target space that specializes the type on Inbound items.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kevin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2007 14:22:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/alfresco-2-1-web-scripts-file-upload/m-p/111538#M78435</guid>
      <dc:creator>kevinr</dc:creator>
      <dc:date>2007-07-23T14:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: Alfresco 2.1 - web scripts - file upload</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/alfresco-2-1-web-scripts-file-upload/m-p/111539#M78436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I can't create a rule, because depends on the content we want to upload. For example, we can upload a JPEG file and it can be 2 different customized types of contents, images or multimedia file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, in this moment, I create 2 nodes. First one using CIFS, and the other new node, specifying the type of content, using webscripts:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;var node2 = userhome.createNode(filename, typeofContent);&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;So then, I copy the cm:content property from the first one to the other.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;node2.properties["cm:content"] = node.properties["cm:content"];&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;And, finally, I remove the first one (node.remove()).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That's the only idea I have to solve this probem. Any othe idea?? Thanks so much!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;–&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Santigt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2007 14:59:57 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/alfresco-2-1-web-scripts-file-upload/m-p/111539#M78436</guid>
      <dc:creator>santigt</dc:creator>
      <dc:date>2007-07-23T14:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: Alfresco 2.1 - web scripts - file upload</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/alfresco-2-1-web-scripts-file-upload/m-p/111540#M78437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I assume you mean using Javascript API not using webscripts (WebScripts is a framework that brings together the existing Templating and Javascript APIs into a cohesive URL addressable framework). Anyway, the cm:content property can only be copied using the JavaScript API if it is a text node (not in your case), so you want something like this instead:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var node2 = node.copy(filename);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;node2.specializeType(typeofContent);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;will do what you want i think.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kevin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2007 15:16:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/alfresco-2-1-web-scripts-file-upload/m-p/111540#M78437</guid>
      <dc:creator>kevinr</dc:creator>
      <dc:date>2007-07-23T15:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: Alfresco 2.1 - web scripts - file upload</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/alfresco-2-1-web-scripts-file-upload/m-p/111541#M78438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ah ok! Well, the other idea runs correctly using binary file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, If I've understood you, I don't need to create the second node, because I can use the specializeType function to change the type of the first node (CIFS node), using webscripts. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is that correct?? With this function, can I change the content type and put my customized type (for example, {multimedia.model}image)&amp;nbsp; ?? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;var node = companyhome.childByNamePath("myfile.jpg");&lt;BR /&gt;node.specializeType("{multimedia.model}image");&lt;BR /&gt;node.save();&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks so much Kevin!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;–&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Santigt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2007 18:51:54 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/alfresco-2-1-web-scripts-file-upload/m-p/111541#M78438</guid>
      <dc:creator>santigt</dc:creator>
      <dc:date>2007-07-23T18:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Alfresco 2.1 - web scripts - file upload</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/alfresco-2-1-web-scripts-file-upload/m-p/111542#M78439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Added support for multipart/form-data requests.&amp;nbsp; See &lt;/SPAN&gt;&lt;A href="http://wiki.alfresco.com/wiki/Web_Scripts#formdata" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/Web_Scripts#formdata&lt;/A&gt;&lt;SPAN&gt; for docs, and &lt;/SPAN&gt;&lt;A href="http://wiki.alfresco.com/wiki/Web_Scripts_Examples#File_Upload" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/Web_Scripts_Examples#File_Upload&lt;/A&gt;&lt;SPAN&gt; for an example of how to support a HTML form posting meta-data and content.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This has gone into 2.1 Enterprise, but should also be available from svn HEAD soon.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2007 14:41:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/alfresco-2-1-web-scripts-file-upload/m-p/111542#M78439</guid>
      <dc:creator>davidc</dc:creator>
      <dc:date>2007-07-31T14:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: Alfresco 2.1 - web scripts - file upload</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/alfresco-2-1-web-scripts-file-upload/m-p/111543#M78440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok, I will wait for this HEAD code…&amp;nbsp; &lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://connect.hyland.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks so much!! Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;–&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Santigt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2007 11:50:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/alfresco-2-1-web-scripts-file-upload/m-p/111543#M78440</guid>
      <dc:creator>santigt</dc:creator>
      <dc:date>2007-08-02T11:50:00Z</dc:date>
    </item>
  </channel>
</rss>

