<?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: Problem with CRSF Token durant Upload (Afresco community 7.3.0) in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/problem-with-crsf-token-durant-upload-afresco-community-7-3-0/m-p/130542#M35270</link>
    <description>&lt;P&gt;That's correct. You can't upload to repository without authentication.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can either send the alf_ticket with the request by first calling login api. or you can use basic authentication mechanism like you did with share. There is "NO WAY" you can bypass authentication and upload to repo AFAIK.&lt;/P&gt;
&lt;P&gt;here are some examples tested via curl:&lt;/P&gt;
&lt;PRE&gt;&lt;STRONG&gt;V1 API example:&lt;BR /&gt;&lt;BR /&gt;Using alf_ticket:&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;" http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children?alf_ticket=TICKET_455c2e0153a24170466005a9b9326607cee59674

&lt;STRONG&gt;OR&lt;/STRONG&gt;

&lt;STRONG&gt;Basic auth:&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;
&lt;P&gt;Repo based api should work same way by passing alf_ticket or basic auth. I don't whether you gone through this:&amp;nbsp;&lt;A href="https://javaworld-abhinav.blogspot.com/2014/09/upload-documents-to-alfresco-using-rest.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://javaworld-abhinav.blogspot.com/2014/09/upload-documents-to-alfresco-using-rest.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;there are in detail steps&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jun 2022 14:14:24 GMT</pubDate>
    <dc:creator>abhinavmishra14</dc:creator>
    <dc:date>2022-06-21T14:14:24Z</dc:date>
    <item>
      <title>Problem with CRSF Token durant Upload (Afresco community 7.3.0)</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/problem-with-crsf-token-durant-upload-afresco-community-7-3-0/m-p/130539#M35267</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I try to test performance with jmeter on alfresco.&amp;nbsp; I would like to send numberous files to see what could be the limit ...&lt;/P&gt;&lt;P&gt;On a old alfresco, when i did upload of some file, the Path used were : /share/proxy/alfresco/api/upload&lt;/P&gt;&lt;P&gt;It permitted me to send files by jmeter on alfresco without problem.&lt;/P&gt;&lt;P&gt;On my new alfresco (7.0.3), the path looks like : (taken by script recorder)&lt;/P&gt;&lt;P&gt;/share/proxy/alfresco/api/upload?Alfresco-CSRFToken=Kx2T3mXBQwVPyhKiD0xwb8AA9Vl0qNV2gO0z1cq3UYM%3D-148&lt;/P&gt;&lt;P&gt;Which doesn't permit to do it by jmeter (can't know the token of session by advance)&lt;/P&gt;&lt;P&gt;I have tried pass CSRFPolicy to "true" in share-config-custom but didn't change anything&lt;/P&gt;&lt;P&gt;Is there a way for not using token when upload a file ???&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2022 06:38:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/problem-with-crsf-token-durant-upload-afresco-community-7-3-0/m-p/130539#M35267</guid>
      <dc:creator>kockg</dc:creator>
      <dc:date>2022-06-17T06:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with CRSF Token durant Upload (Afresco community 7.3.0)</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/problem-with-crsf-token-durant-upload-afresco-community-7-3-0/m-p/130540#M35268</link>
      <description>&lt;P&gt;Alfresco 7.3 is still not officially released AFAIK, as you have mentioned the version in the title of the post, but i believe you are using 7.0.x version. Just in case, Use the latest stable release version from here:&amp;nbsp;&lt;A href="https://www.alfresco.com/thank-you/thank-you-downloading-alfresco-community-edition" target="_blank" rel="noopener nofollow noreferrer"&gt;https://www.alfresco.com/thank-you/thank-you-downloading-alfresco-community-edition&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Why don't you use these API calls if the goal is to load test uploads:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;POST: /alfresco/service/api/upload&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;You can find additional details about the upload api (&lt;STRONG&gt;/alfresco/service/api/upload&lt;/STRONG&gt;) here:&amp;nbsp;&lt;A href="https://javaworld-abhinav.blogspot.com/2014/09/upload-documents-to-alfresco-using-rest.html" target="_blank" rel="noopener nofollow noreferrer"&gt;https://javaworld-abhinav.blogspot.com/2014/09/upload-documents-to-alfresco-using-rest.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You can also take a look at this jmeter plugin that can be used to load test uplods via http or ftp :&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;A href="https://github.com/abhinavmishra14/AlfrescoJMeterLoadTestPlugin" target="_blank" rel="noopener nofollow noreferrer"&gt;https://github.com/abhinavmishra14/AlfrescoJMeterLoadTestPlugin&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;or&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Use V1 REST API for upload requests:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;POST: &lt;A href="https://docs.alfresco.com/content-services/7.0/develop/rest-api-guide/folders-files/#uploadfile" target="_self" rel="nofollow noopener noreferrer"&gt;/alfresco/api/-default-/public/alfresco/versions/1/nodes/{id}/children&lt;/A&gt;&lt;/PRE&gt;
&lt;P&gt;On the other hand, you have option to disbale csrf by adding following to alfresco-global.properties &lt;STRONG&gt;(Not recommeded for production environment)&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;csrf.filter.enabled=false  &lt;/PRE&gt;
&lt;P&gt;and for share, update the share-config-custom.xml:&lt;/P&gt;
&lt;PRE&gt;&amp;lt;config evaluator="string-compare" condition="CSRFPolicy" replace="true"&amp;gt;
   &amp;lt;filter/&amp;gt;
&amp;lt;/config&amp;gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Jun 2022 17:34:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/problem-with-crsf-token-durant-upload-afresco-community-7-3-0/m-p/130540#M35268</guid>
      <dc:creator>abhinavmishra14</dc:creator>
      <dc:date>2022-06-17T17:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with CRSF Token durant Upload (Afresco community 7.3.0)</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/problem-with-crsf-token-durant-upload-afresco-community-7-3-0/m-p/130541#M35269</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Thanks for answer.&lt;/P&gt;&lt;P&gt;I really use the version 7.3.0 (version I have obtained using docker way of installation of the community)&lt;/P&gt;&lt;P&gt;I tried :&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;POST: /alfresco/service/api/upload&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;But it doesn't work on that version &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://connect.hyland.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Seems it need a session token , which make my problem ....&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jun 2022 05:58:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/problem-with-crsf-token-durant-upload-afresco-community-7-3-0/m-p/130541#M35269</guid>
      <dc:creator>kockg</dc:creator>
      <dc:date>2022-06-20T05:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with CRSF Token durant Upload (Afresco community 7.3.0)</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/problem-with-crsf-token-durant-upload-afresco-community-7-3-0/m-p/130542#M35270</link>
      <description>&lt;P&gt;That's correct. You can't upload to repository without authentication.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can either send the alf_ticket with the request by first calling login api. or you can use basic authentication mechanism like you did with share. There is "NO WAY" you can bypass authentication and upload to repo AFAIK.&lt;/P&gt;
&lt;P&gt;here are some examples tested via curl:&lt;/P&gt;
&lt;PRE&gt;&lt;STRONG&gt;V1 API example:&lt;BR /&gt;&lt;BR /&gt;Using alf_ticket:&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;" http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children?alf_ticket=TICKET_455c2e0153a24170466005a9b9326607cee59674

&lt;STRONG&gt;OR&lt;/STRONG&gt;

&lt;STRONG&gt;Basic auth:&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;
&lt;P&gt;Repo based api should work same way by passing alf_ticket or basic auth. I don't whether you gone through this:&amp;nbsp;&lt;A href="https://javaworld-abhinav.blogspot.com/2014/09/upload-documents-to-alfresco-using-rest.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://javaworld-abhinav.blogspot.com/2014/09/upload-documents-to-alfresco-using-rest.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;there are in detail steps&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2022 14:14:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/problem-with-crsf-token-durant-upload-afresco-community-7-3-0/m-p/130542#M35270</guid>
      <dc:creator>abhinavmishra14</dc:creator>
      <dc:date>2022-06-21T14:14:24Z</dc:date>
    </item>
  </channel>
</rss>

