
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2021 09:43 AM
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
- Labels:
-
Alfresco Content Services
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2021 01:42 PM
@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
(ACSCE, AWS SAA, Azure Admin)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2021 01:42 PM
@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
(ACSCE, AWS SAA, Azure Admin)
