<?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: I want to add a document in a subdirectory in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/i-want-to-add-a-document-in-a-subdirectory/m-p/93591#M27663</link>
    <description>&lt;P&gt;Look at this documentation:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.alfresco.com/6.1/concepts/dev-api-by-language-alf-rest-upload-file.html" target="_blank" rel="noopener nofollow noreferrer"&gt;https://docs.alfresco.com/6.1/concepts/dev-api-by-language-alf-rest-upload-file.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;
&lt;P&gt;[Edit] :&amp;nbsp;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/76783"&gt;@EddieMay&lt;/A&gt;&amp;nbsp; already responded.&lt;/P&gt;</description>
    <pubDate>Wed, 29 Apr 2020 15:31:12 GMT</pubDate>
    <dc:creator>abhinavmishra14</dc:creator>
    <dc:date>2020-04-29T15:31:12Z</dc:date>
    <item>
      <title>I want to add a document in a subdirectory</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/i-want-to-add-a-document-in-a-subdirectory/m-p/93589#M27661</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I want to add a document in a subdirectory. For example.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a folder in -shared-/Test&lt;/P&gt;&lt;P&gt;I want to add a document inside the TEST folder&lt;/P&gt;&lt;P&gt;I would like something like that&lt;/P&gt;&lt;P&gt;&lt;A href="http://127.0.0.1:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-shared-TEST-/children" target="_blank" rel="nofollow noopener noreferrer"&gt;http://127.0.0.1:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-shared-TEST-/children&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 19:54:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/i-want-to-add-a-document-in-a-subdirectory/m-p/93589#M27661</guid>
      <dc:creator>viperboys</dc:creator>
      <dc:date>2020-04-28T19:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: I want to add a document in a subdirectory</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/i-want-to-add-a-document-in-a-subdirectory/m-p/93590#M27662</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/80230"&gt;@viperboys&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You can pass a relativePath value as part of your API call -&lt;/P&gt;
&lt;P&gt;I've just used POSTMAN to test the following API call:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;http://localhost:80/alfresco/api/-default-/public/alfresco/versions/1/nodes/-my-/children?alf_ticket=TICKET_579f7268c8de745562aa7e8d1920abf8ec1b382a&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I've set relativePath to "/Shared/Test"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;As you'll see from the screenshot, I now have a document in the Shared/TEST folder.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;HTH,&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 15:27:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/i-want-to-add-a-document-in-a-subdirectory/m-p/93590#M27662</guid>
      <dc:creator>EddieMay</dc:creator>
      <dc:date>2020-04-29T15:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: I want to add a document in a subdirectory</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/i-want-to-add-a-document-in-a-subdirectory/m-p/93591#M27663</link>
      <description>&lt;P&gt;Look at this documentation:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.alfresco.com/6.1/concepts/dev-api-by-language-alf-rest-upload-file.html" target="_blank" rel="noopener nofollow noreferrer"&gt;https://docs.alfresco.com/6.1/concepts/dev-api-by-language-alf-rest-upload-file.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;
&lt;P&gt;[Edit] :&amp;nbsp;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/76783"&gt;@EddieMay&lt;/A&gt;&amp;nbsp; already responded.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 15:31:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/i-want-to-add-a-document-in-a-subdirectory/m-p/93591#M27663</guid>
      <dc:creator>abhinavmishra14</dc:creator>
      <dc:date>2020-04-29T15:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: I want to add a document in a subdirectory</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/i-want-to-add-a-document-in-a-subdirectory/m-p/93592#M27664</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/76783"&gt;@EddieMay&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for you helping..&lt;/P&gt;&lt;P&gt;And how do I configure that relativePath ??&amp;nbsp;I don't see the TEST directory in the URL&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 16:14:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/i-want-to-add-a-document-in-a-subdirectory/m-p/93592#M27664</guid>
      <dc:creator>viperboys</dc:creator>
      <dc:date>2020-04-29T16:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: I want to add a document in a subdirectory</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/i-want-to-add-a-document-in-a-subdirectory/m-p/93593#M27665</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/80230"&gt;@viperboys&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I manually created the directory within Share - logged in as Admin. Hence I knew the relativePath would be "/Shared/TEST".&lt;/P&gt;
&lt;P&gt;HTH,&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 17:31:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/i-want-to-add-a-document-in-a-subdirectory/m-p/93593#M27665</guid>
      <dc:creator>EddieMay</dc:creator>
      <dc:date>2020-04-29T17:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: I want to add a document in a subdirectory</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/i-want-to-add-a-document-in-a-subdirectory/m-p/93594#M27666</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/76783"&gt;@EddieMay&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't find that option you tell me. Can you send me a screenshot?&lt;/P&gt;&lt;P&gt;I don't know if I am doing it correctly. I'm looking at the Alfresco configuration but can't find it ..&amp;nbsp;I want to send files to different folders in different site. For now I only do it to the root directory.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 20:49:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/i-want-to-add-a-document-in-a-subdirectory/m-p/93594#M27666</guid>
      <dc:creator>viperboys</dc:creator>
      <dc:date>2020-04-29T20:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: I want to add a document in a subdirectory</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/i-want-to-add-a-document-in-a-subdirectory/m-p/93595#M27667</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/80230"&gt;@viperboys&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;If you look at the api explorer -&amp;nbsp;&lt;A href="https://api-explorer.alfresco.com/api-explorer/#!/nodes/createNode" target="_blank" rel="nofollow noopener noreferrer"&gt;https://api-explorer.alfresco.com/api-explorer/#!/nodes/createNode&lt;/A&gt;&amp;nbsp;-&amp;nbsp;you will see in the notes about using the relativePath variable.&lt;/P&gt;
&lt;PRE&gt;You can use the relativePath field to specify the folder structure to create relative to &lt;BR /&gt;the node nodeId. Folders in the relativePath that do not exist are created before the &lt;BR /&gt;node is created.&lt;/PRE&gt;
&lt;P&gt;The code in the payload my look a little like this:&lt;/P&gt;
&lt;PRE&gt;{
  "name":"My Special Folder",
  "nodeType":"cm:folder",
  "relativePath":"X/Y/Z"
}&lt;/PRE&gt;
&lt;P&gt;The API documentation says, "&lt;SPAN&gt;The&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;relativePath&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;specifies the folder structure to create relative to the node&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;nodeId&lt;/STRONG&gt;&lt;SPAN&gt;. Folders in the&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;relativePath&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;that do not exist are created before the node is created.&lt;/SPAN&gt;"&lt;/P&gt;
&lt;P&gt;I've just tested uploading to a named folder using PHP. My code is as follows:&lt;/P&gt;
&lt;PRE&gt;&amp;lt;?php
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL =&amp;gt; "http://localhost/alfresco/api/-default-/public/alfresco/versions/1/nodes/-my-/children?alf_ticket=TICKET_1229b18962a93a9928878a7da424f19222f71df2",
  CURLOPT_RETURNTRANSFER =&amp;gt; true,
  CURLOPT_ENCODING =&amp;gt; "",
  CURLOPT_MAXREDIRS =&amp;gt; 10,
  CURLOPT_TIMEOUT =&amp;gt; 0,
  CURLOPT_FOLLOWLOCATION =&amp;gt; true,
  CURLOPT_HTTP_VERSION =&amp;gt; CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST =&amp;gt; "POST",
  CURLOPT_POSTFIELDS =&amp;gt; array('name' =&amp;gt; 'Eddie May Upload',&lt;BR /&gt;       'relativePath'=&amp;gt;'Shared/TEST',&lt;BR /&gt;       'filedata'=&amp;gt; new CURLFILE('/Users/emay/Desktop/Test/TEST TWO.docx')),
  CURLOPT_HTTPHEADER =&amp;gt; array(
    "Authorization: Basic dGVzdDp0ZXN0"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;&lt;/PRE&gt;
&lt;P&gt;The response was as follows:&lt;/P&gt;
&lt;PRE&gt;{"entry":{"isFile":true,"createdByUser":{"id":"admin","displayName":"Administrator"},"modifiedAt":"2020-04-30T10:55:12.868+0000","nodeType":"cm:content",&lt;BR /&gt;"content":{"mimeType":"application/vnd.openxmlformats-officedocument.wordprocessingml.document","mimeTypeName":"Microsoft Word 2007","sizeInBytes":11760,"encoding":"UTF-8"},&lt;BR /&gt;"parentId":"9191350a-cadf-4afa-95c2-24203a8d9475","aspectNames":["cm:versionable","cm:titled","cm:auditable","cm:author"],"createdAt":"2020-04-30T10:55:08.176+0000","isFolder":false,&lt;BR /&gt;"modifiedByUser":{"id":"admin","displayName":"Administrator"},"name":"Eddie May Upload","id":"adc1d7b8-7381-467c-9278-c10bb5e29ccd","properties":{"cm:versionLabel":"1.0",&lt;BR /&gt;"cm:author":"Eddie May","cm:versionType":"MAJOR"}}}&lt;/PRE&gt;
&lt;P&gt;You can see in the screenshot that the file was uploaded to the Shared/TEST folder off the repository root.&lt;/P&gt;
&lt;P&gt;So, this code will send a file using PHP to a named folder within the Alfresco repository.&lt;/P&gt;
&lt;P&gt;I'm not sure of your full requirement, but it looks like you will have to figure out which folders to upload to on the fly, perhaps using&amp;nbsp;&lt;A href="https://api-explorer.alfresco.com/api-explorer/#!/sites/listSiteContainers" target="_blank" rel="nofollow noopener noreferrer"&gt;https://api-explorer.alfresco.com/api-explorer/#!/sites/listSiteContainers&lt;/A&gt;&amp;nbsp;to find the folders within a site?&lt;/P&gt;
&lt;P&gt;HTH,&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 11:10:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/i-want-to-add-a-document-in-a-subdirectory/m-p/93595#M27667</guid>
      <dc:creator>EddieMay</dc:creator>
      <dc:date>2020-04-30T11:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: I want to add a document in a subdirectory</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/i-want-to-add-a-document-in-a-subdirectory/m-p/93596#M27668</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/76783"&gt;@EddieMay&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for you helping.. Now work fine for me. &lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://connect.hyland.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just to confirm,&amp;nbsp;From this URL&amp;nbsp;&lt;A href="http://127.0.0.1:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-shared-/children.&amp;nbsp;&amp;nbsp;Can" target="_blank" rel="nofollow noopener noreferrer"&gt;http://127.0.0.1:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-shared-/children.&amp;nbsp;&amp;nbsp;Can&lt;/A&gt; I add for which site and which folder I send the file? For example:&lt;/P&gt;&lt;PRE&gt;CURLOPT_POSTFIELDS =&amp;gt; array('name' =&amp;gt; 'Eddie May Upload',&lt;BR /&gt;       'site'=&amp;gt;'New site'&lt;BR /&gt;       'relativePath'=&amp;gt;'Shared/TEST',&lt;BR /&gt;       'filedata'=&amp;gt; new CURLFILE('/Users/emay/Desktop/Test/TEST TWO.docx')),&lt;/PRE&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 13:40:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/i-want-to-add-a-document-in-a-subdirectory/m-p/93596#M27668</guid>
      <dc:creator>viperboys</dc:creator>
      <dc:date>2020-05-01T13:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: I want to add a document in a subdirectory</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/i-want-to-add-a-document-in-a-subdirectory/m-p/93597#M27669</link>
      <description>&lt;P&gt;Hi &lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/74498"&gt;@abhinavmishra14&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for you helping.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 13:51:03 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/i-want-to-add-a-document-in-a-subdirectory/m-p/93597#M27669</guid>
      <dc:creator>viperboys</dc:creator>
      <dc:date>2020-05-01T13:51:03Z</dc:date>
    </item>
  </channel>
</rss>

