<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Rest API - Upload file to specific folder of a site in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/rest-api-upload-file-to-specific-folder-of-a-site/m-p/124676#M34068</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/86880"&gt;@ludoADV&lt;/A&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I try to upload a file to folder 'documentLibrary/CERTs' defined to '0' site using following cURL command:&lt;/P&gt;
&lt;PRE&gt;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&lt;/PRE&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;test2.txt document is correctly uploaded but in '/' repository, not in '/Sites/0/documentLibrary/CERTs' folder.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;My ACS instance is running on Community 7.1.0&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;

&lt;P&gt;The correct way is the below examples, you have to provide the site (&lt;STRONG&gt;testsite&lt;/STRONG&gt; is the siteshortname and &lt;STRONG&gt;myfolder&amp;nbsp;&lt;/STRONG&gt;after&amp;nbsp;documentLibraryis the folder&amp;nbsp;where file needs to be uploaded) with foldername path for &lt;STRONG&gt;relativePath &lt;/STRONG&gt;param, see example below:&lt;/P&gt;
&lt;PRE&gt;$ 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 "&lt;STRONG&gt;relativePath=/Sites/&lt;FONT color="#FF0000"&gt;testsite&lt;/FONT&gt;/documentLibrary/&lt;FONT color="#FF0000"&gt;myfolder&lt;/FONT&gt;&lt;/STRONG&gt;" http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children?alf_ticket=TICKET_455c2e0153a24170466005a9b9326607cee59674

&lt;STRONG&gt;OR&lt;/STRONG&gt;

$ 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 "&lt;STRONG&gt;relativePath=/Sites/&lt;FONT color="#FF0000"&gt;testsite&lt;/FONT&gt;/documentLibrary/&lt;FONT color="#FF0000"&gt;myfolder&lt;/FONT&gt;&lt;/STRONG&gt;" -H 'Authorization: Basic VElDS0VUXzQ1NWMyZTAxNTNhMjQxNzA0NjYwMDVhOWI5MzI2NjA3Y2VlNTk2NzQ=' http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children&lt;/PRE&gt;</description>
    <pubDate>Mon, 09 Aug 2021 17:42:07 GMT</pubDate>
    <dc:creator>abhinavmishra14</dc:creator>
    <dc:date>2021-08-09T17:42:07Z</dc:date>
    <item>
      <title>Rest API - Upload file to specific folder of a site</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/rest-api-upload-file-to-specific-folder-of-a-site/m-p/124675#M34067</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I try to upload a file to folder 'documentLibrary/CERTs' defined to '0' site using following cURL command:&lt;/P&gt;&lt;PRE&gt;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&lt;/PRE&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;test2.txt document is correctly uploaded but in '/' repository, not in '/Sites/0/documentLibrary/CERTs' folder.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;My ACS instance is running on Community 7.1.0&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 13:43:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/rest-api-upload-file-to-specific-folder-of-a-site/m-p/124675#M34067</guid>
      <dc:creator>ludoADV</dc:creator>
      <dc:date>2021-08-09T13:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: Rest API - Upload file to specific folder of a site</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/rest-api-upload-file-to-specific-folder-of-a-site/m-p/124676#M34068</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/86880"&gt;@ludoADV&lt;/A&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I try to upload a file to folder 'documentLibrary/CERTs' defined to '0' site using following cURL command:&lt;/P&gt;
&lt;PRE&gt;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&lt;/PRE&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;test2.txt document is correctly uploaded but in '/' repository, not in '/Sites/0/documentLibrary/CERTs' folder.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;My ACS instance is running on Community 7.1.0&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;

&lt;P&gt;The correct way is the below examples, you have to provide the site (&lt;STRONG&gt;testsite&lt;/STRONG&gt; is the siteshortname and &lt;STRONG&gt;myfolder&amp;nbsp;&lt;/STRONG&gt;after&amp;nbsp;documentLibraryis the folder&amp;nbsp;where file needs to be uploaded) with foldername path for &lt;STRONG&gt;relativePath &lt;/STRONG&gt;param, see example below:&lt;/P&gt;
&lt;PRE&gt;$ 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 "&lt;STRONG&gt;relativePath=/Sites/&lt;FONT color="#FF0000"&gt;testsite&lt;/FONT&gt;/documentLibrary/&lt;FONT color="#FF0000"&gt;myfolder&lt;/FONT&gt;&lt;/STRONG&gt;" http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children?alf_ticket=TICKET_455c2e0153a24170466005a9b9326607cee59674

&lt;STRONG&gt;OR&lt;/STRONG&gt;

$ 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 "&lt;STRONG&gt;relativePath=/Sites/&lt;FONT color="#FF0000"&gt;testsite&lt;/FONT&gt;/documentLibrary/&lt;FONT color="#FF0000"&gt;myfolder&lt;/FONT&gt;&lt;/STRONG&gt;" -H 'Authorization: Basic VElDS0VUXzQ1NWMyZTAxNTNhMjQxNzA0NjYwMDVhOWI5MzI2NjA3Y2VlNTk2NzQ=' http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Aug 2021 17:42:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/rest-api-upload-file-to-specific-folder-of-a-site/m-p/124676#M34068</guid>
      <dc:creator>abhinavmishra14</dc:creator>
      <dc:date>2021-08-09T17:42:07Z</dc:date>
    </item>
  </channel>
</rss>

