Hello,
I try to upload a file to folder 'documentLibrary/CERTs' defined to '0' site using following cURL command:
curl -X POST -F filedata=@test2.txt -F ‘nodeType=\"cm:content\"’ -F ‘relativePath=\"CERTs\"’ -H 'Authorization: Basic VElDS0VUXzUyMzU1YmE4NzhkOWEwMTNmNjk4MjNjYTRiZGY5YjNiMDdkNmJjNWM=' http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children
test2.txt document is correctly uploaded but in '/' repository, not in '/Sites/0/documentLibrary/CERTs' folder.
My ACS instance is running on Community 7.1.0
Solved! Go to Solution.
@ludoADV wrote:
Hello,
I try to upload a file to folder 'documentLibrary/CERTs' defined to '0' site using following cURL command:
curl -X POST -F filedata=@test2.txt -F ‘nodeType=\"cm:content\"’ -F ‘relativePath=\"CERTs\"’ -H 'Authorization: Basic VElDS0VUXzUyMzU1YmE4NzhkOWEwMTNmNjk4MjNjYTRiZGY5YjNiMDdkNmJjNWM=' http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/childrentest2.txt document is correctly uploaded but in '/' repository, not in '/Sites/0/documentLibrary/CERTs' folder.
My ACS instance is running on Community 7.1.0
The correct way is the below examples, you have to provide the site (testsite is the siteshortname and myfolder after documentLibraryis the folder where file needs to be uploaded) with foldername path for relativePath param, see example below:
$ curl -X POST -F filedata=@test2.txt -F "name=somefile.txt" -F "nodeType=cm:content" -F "cm:title=My text" -F "cm:description=My text document description" -F "relativePath=/Sites/testsite/documentLibrary/myfolder" http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children?alf_ticket=TICKET_455c2e0153a24170466005a9b9326607cee59674 OR $ curl -X POST -F filedata=@test2.txt -F "name=somefile.txt" -F "nodeType=cm:content" -F "cm:title=My text" -F "cm:description=My text document description" -F "relativePath=/Sites/testsite/documentLibrary/myfolder" -H 'Authorization: Basic VElDS0VUXzQ1NWMyZTAxNTNhMjQxNzA0NjYwMDVhOWI5MzI2NjA3Y2VlNTk2NzQ=' http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children
@ludoADV wrote:
Hello,
I try to upload a file to folder 'documentLibrary/CERTs' defined to '0' site using following cURL command:
curl -X POST -F filedata=@test2.txt -F ‘nodeType=\"cm:content\"’ -F ‘relativePath=\"CERTs\"’ -H 'Authorization: Basic VElDS0VUXzUyMzU1YmE4NzhkOWEwMTNmNjk4MjNjYTRiZGY5YjNiMDdkNmJjNWM=' http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/childrentest2.txt document is correctly uploaded but in '/' repository, not in '/Sites/0/documentLibrary/CERTs' folder.
My ACS instance is running on Community 7.1.0
The correct way is the below examples, you have to provide the site (testsite is the siteshortname and myfolder after documentLibraryis the folder where file needs to be uploaded) with foldername path for relativePath param, see example below:
$ curl -X POST -F filedata=@test2.txt -F "name=somefile.txt" -F "nodeType=cm:content" -F "cm:title=My text" -F "cm:description=My text document description" -F "relativePath=/Sites/testsite/documentLibrary/myfolder" http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children?alf_ticket=TICKET_455c2e0153a24170466005a9b9326607cee59674 OR $ curl -X POST -F filedata=@test2.txt -F "name=somefile.txt" -F "nodeType=cm:content" -F "cm:title=My text" -F "cm:description=My text document description" -F "relativePath=/Sites/testsite/documentLibrary/myfolder" -H 'Authorization: Basic VElDS0VUXzQ1NWMyZTAxNTNhMjQxNzA0NjYwMDVhOWI5MzI2NjA3Y2VlNTk2NzQ=' http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.