cancel
Showing results for 
Search instead for 
Did you mean: 

upload file into a specific folder

lpgc
Champ in-the-making
Champ in-the-making
Hi, im new to Alfresco and im just going through the different webscript examples. The one im looking right now is a form to upload a file into alfresco root home setting the title and description. It works 100% ….

The prob comes when i try to upload the file to a different folder. This is what ive been trying:


var folder = roothome.childByNamePath("Sites/my new folder");
upload = folder.createFile(filename) ;

Since i havent found any example around im not even sure this is the correct way to proceed, so any help will be nice  :idea:

Thanks in Advance.
3 REPLIES 3

abarisone
Star Contributor
Star Contributor
Hi,
here http://wiki.alfresco.com/wiki/4.0_JavaScript_API#ScriptNode_API you can find more info about ScriptNode API
Some examples here http://wiki.alfresco.com/wiki/Web_Scripts_Examples
General info about WebScripts anatomy here https://wiki.alfresco.com/wiki/Web_Scripts

Regards,
Andrea

lpgc
Champ in-the-making
Champ in-the-making
worked for me, after a bit of reading 🙂


var folder = companyhome.childByNamePath("Sites/subfolder1/subforder2");
upload = folder.createFile(filename) ;
upload.save();

Thanks for the help.

fgjohnson
Champ in-the-making
Champ in-the-making
I have tried this and it fails… v. 4.2e.
Can you provide more details?

The logic seems to work…
Have there been changes in CE 4.2e?