<?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 Upload related content from APS process to ACS via API in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/upload-related-content-from-aps-process-to-acs-via-api/m-p/34845#M14720</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm struggling with the upload of content inside a process in APS (1.9, Enterprise) to ACS via the REST-API. Until now I could use the "publish to Alfresco"-Task, but I'm not able to set the site if the sitename is created inside this process - even if I add the variable to the bpmn20.xml like&lt;/P&gt;&lt;PRE&gt;        &amp;lt;activiti:field name="site"&amp;gt;
          &amp;lt;activiti:string&amp;gt;&amp;lt;![CDATA[${sitename}]]&amp;gt;&amp;lt;/activiti:string&amp;gt;
        &amp;lt;/activiti:field&amp;gt;&lt;/PRE&gt;&lt;P&gt;The error message is: "/sites/${sitename} does not exist". So I think Alfresco treats the variable as a string. Funny thing is, that this works for a subfolder:&lt;/P&gt;&lt;PRE&gt;        &amp;lt;activiti:field name="createFolder"&amp;gt;
          &amp;lt;activiti:expression&amp;gt;&amp;lt;![CDATA[${foldername}]]&amp;gt;&amp;lt;/activiti:expression&amp;gt;
        &amp;lt;/activiti:field&amp;gt;&lt;/PRE&gt;&lt;P&gt;That's why I have to use REST Calls for more flexibility. What I've found and tried out is this:&amp;nbsp;&lt;A href="https://docs.alfresco.com/6.1/concepts/dev-api-by-language-alf-rest-upload-file.html" target="_self" rel="nofollow noopener noreferrer"&gt;Link&lt;/A&gt;&amp;nbsp;. Now I'm able to create a site, to add members, to create folders - everything what I need apart from uploading files belonging to some upload formfield in process. Uploading from local storage is not a big deal (see link) and creating a blank file is a piece of cake.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that the processfiles are relatedContent and that they have a contentId. During execution this is the only variable I have about the uploaded file. So I tried to add it like this to the JSON with&amp;nbsp; &lt;STRONG&gt;POST&lt;/STRONG&gt; /&lt;STRONG&gt;nodes/{id}/children:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;{
  "name": ${contentId},
  "nodeType": "cm:content",
}&lt;/PRE&gt;&lt;P&gt;but this did not work. The contentId is not directly the file. So where is the file or where is its content stored? And at the end: How could I upload this relatedContent to ACS via API?&lt;/P&gt;&lt;P&gt;Cheers and thanks a lot,&lt;/P&gt;&lt;P&gt;Jannik&lt;/P&gt;</description>
    <pubDate>Fri, 06 Mar 2020 13:01:31 GMT</pubDate>
    <dc:creator>Jannik</dc:creator>
    <dc:date>2020-03-06T13:01:31Z</dc:date>
    <item>
      <title>Upload related content from APS process to ACS via API</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/upload-related-content-from-aps-process-to-acs-via-api/m-p/34845#M14720</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm struggling with the upload of content inside a process in APS (1.9, Enterprise) to ACS via the REST-API. Until now I could use the "publish to Alfresco"-Task, but I'm not able to set the site if the sitename is created inside this process - even if I add the variable to the bpmn20.xml like&lt;/P&gt;&lt;PRE&gt;        &amp;lt;activiti:field name="site"&amp;gt;
          &amp;lt;activiti:string&amp;gt;&amp;lt;![CDATA[${sitename}]]&amp;gt;&amp;lt;/activiti:string&amp;gt;
        &amp;lt;/activiti:field&amp;gt;&lt;/PRE&gt;&lt;P&gt;The error message is: "/sites/${sitename} does not exist". So I think Alfresco treats the variable as a string. Funny thing is, that this works for a subfolder:&lt;/P&gt;&lt;PRE&gt;        &amp;lt;activiti:field name="createFolder"&amp;gt;
          &amp;lt;activiti:expression&amp;gt;&amp;lt;![CDATA[${foldername}]]&amp;gt;&amp;lt;/activiti:expression&amp;gt;
        &amp;lt;/activiti:field&amp;gt;&lt;/PRE&gt;&lt;P&gt;That's why I have to use REST Calls for more flexibility. What I've found and tried out is this:&amp;nbsp;&lt;A href="https://docs.alfresco.com/6.1/concepts/dev-api-by-language-alf-rest-upload-file.html" target="_self" rel="nofollow noopener noreferrer"&gt;Link&lt;/A&gt;&amp;nbsp;. Now I'm able to create a site, to add members, to create folders - everything what I need apart from uploading files belonging to some upload formfield in process. Uploading from local storage is not a big deal (see link) and creating a blank file is a piece of cake.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that the processfiles are relatedContent and that they have a contentId. During execution this is the only variable I have about the uploaded file. So I tried to add it like this to the JSON with&amp;nbsp; &lt;STRONG&gt;POST&lt;/STRONG&gt; /&lt;STRONG&gt;nodes/{id}/children:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;{
  "name": ${contentId},
  "nodeType": "cm:content",
}&lt;/PRE&gt;&lt;P&gt;but this did not work. The contentId is not directly the file. So where is the file or where is its content stored? And at the end: How could I upload this relatedContent to ACS via API?&lt;/P&gt;&lt;P&gt;Cheers and thanks a lot,&lt;/P&gt;&lt;P&gt;Jannik&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2020 13:01:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/upload-related-content-from-aps-process-to-acs-via-api/m-p/34845#M14720</guid>
      <dc:creator>Jannik</dc:creator>
      <dc:date>2020-03-06T13:01:31Z</dc:date>
    </item>
  </channel>
</rss>

