Uploading somewhere other than company home
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2008 05:51 AM
Hi,
I have followed the example in http://wiki.alfresco.com/wiki/Web_Scripts_Examples#Upload_Form to upload files to the alfresco repository. The files always end up in the company home space. how do I specify the space I want to use?
eg. company home/user homes/abritrary space
Cheers,
Mellen.
I have followed the example in http://wiki.alfresco.com/wiki/Web_Scripts_Examples#Upload_Form to upload files to the alfresco repository. The files always end up in the company home space. how do I specify the space I want to use?
eg. company home/user homes/abritrary space
Cheers,
Mellen.
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2008 07:11 AM
I've solved my query.
To select the space you want to upload to do this (if the space is in user homes):
then to create the file in the selected space, change the file upload example
from
To select the space you want to upload to do this (if the space is in user homes):
var space_to_use = companyhome.childByNamePath("User Homes/path/to/space");
where "path/to/space" is the path to your desired space.then to create the file in the selected space, change the file upload example
from
upload = companyhome.createFile("upload" + companyhome.children.length + "_" + filename) ;
to upload = space_to_use.createFile("upload" + space_to_use.children.length + "_" + filename) ;

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2014 02:23 PM
Thank you.
This works fine.
I was incorrectly assuming I needed 'companyhome' as a global at the beginning of the Path.
Note for Newbies…
Use the true path of where you want it to go.
e.g.
var space_to_use = companyhome.childByNamePath("Sites/uploads/documentLibrary/Uploads");
var space_to_use = companyhome.childByNamePath("Shared/Images");
var space_to_use = companyhome.childByNamePath("User Homes/reviewer/Review");
Hope this helps.
This works fine.
I was incorrectly assuming I needed 'companyhome' as a global at the beginning of the Path.
Note for Newbies…
Use the true path of where you want it to go.
e.g.
var space_to_use = companyhome.childByNamePath("Sites/uploads/documentLibrary/Uploads");
var space_to_use = companyhome.childByNamePath("Shared/Images");
var space_to_use = companyhome.childByNamePath("User Homes/reviewer/Review");
Hope this helps.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2015 11:58 AM
Hola buen día:
Gracias por su aportación, resulto de gran ayuda
Saludos
Gracias por su aportación, resulto de gran ayuda
Saludos
