cancel
Showing results for 
Search instead for 
Did you mean: 

Javascript api and content

ajshaw
Champ in-the-making
Champ in-the-making
Is it, or will it be possible, to set a node's content with a file (eg an jpeg) from a file upload control, using the javascript api?

such as :

myNode.content = args["uploadedFile"];


Tanks Smiley Happy
4 REPLIES 4

kevinr
Star Contributor
Star Contributor
No i don't think that will be easy Smiley Sad The JavaScript engine executes within the context of the repository - it has no access to web-client beans or JSF upload components etc. It would need some custom code to stream the content to a location that the JavaScript engine could access before it could deal with the uploaded content.

Thanks,

Kevin

ajshaw
Champ in-the-making
Champ in-the-making
Ok. Thanks.

santigt
Champ in-the-making
Champ in-the-making
Hi everybody!

I see at Wiki that we can upload files using javascript API. There is an example of this (please see http://wiki.alfresco.com/wiki/Web_Scripts_Examples#File_Upload). But I saw that we can use "formdata" object only if we use Alfresco Enterprise, not Alfresco Community (see http://wiki.alfresco.com/wiki/Web_Scripts#Appendix_A:_Web_Script_Root_Objects).

My questions are: Is different the source code from the Alfresco Enterprise ?? Can we use this object on Alfresco Community ?? How can we upload files??

Thanks so much!! Regards,




Santigt

davidc
Star Contributor
Star Contributor
This enhancement would of gone into 2.1 community, but it didn't make it due to time.

It will propagate to SVN HEAD soon.