<?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 have a issue when i try send a file to Alfresco in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/i-have-a-issue-when-i-try-send-a-file-to-alfresco/m-p/109018#M30581</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;Hello .. I already managed to solve my problem. I did it with Jquery and it works perfectly.&lt;/P&gt;&lt;P&gt;Thank you..&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 May 2020 21:08:06 GMT</pubDate>
    <dc:creator>viperboys</dc:creator>
    <dc:date>2020-05-07T21:08:06Z</dc:date>
    <item>
      <title>I have a issue when i try send a file to Alfresco</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/i-have-a-issue-when-i-try-send-a-file-to-alfresco/m-p/109012#M30575</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am try send a file to Alfresco.. My site web is Wordpress and i use a plugin Gravity Flow. I am creating a snippe pero this code is not work for me. This is me code&amp;nbsp;&lt;/P&gt;&lt;P&gt;public function process(){&lt;BR /&gt;// Do something here.&lt;BR /&gt;$entry = $this-&amp;gt;get_entry();&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$file = file_get_contents($entry['1']);&lt;BR /&gt;$url = '&lt;A href="http://127.0.0.1:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-shared-/children?alf_ticket=TICKET_1a3f7c17063af5f65b0b128f2f2ddeb2021d2258" target="_blank" rel="nofollow noopener noreferrer"&gt;http://127.0.0.1:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-shared-/children?alf_ticket=TICKET_1a3f7c17063af5f65b0b128f2f2ddeb2021d2258&lt;/A&gt;';&lt;BR /&gt;$ch = curl_init();&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;curl_setopt( $ch, CURLOPT_URL, $url );&lt;BR /&gt;curl_setopt( $ch, CURLOPT_POST, 1 );&lt;BR /&gt;curl_setopt( $ch, CURLOPT_POSTFIELDS, $file );&lt;BR /&gt;curl_setopt( $ch, CURLOPT_HTTPHEADER, [&lt;BR /&gt;'Content-Disposition: form-data; filedata="Bilgais1.docx"',&lt;BR /&gt;&lt;BR /&gt;] );&lt;BR /&gt;$result = curl_exec( $ch );&lt;BR /&gt;curl_close( $ch );&lt;BR /&gt;print_r( json_decode( $result ) );&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;return true;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;I have this error&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{"error":{"errorKey":"Could not read content from HTTP request body: Unexpected character ('P' (code 80)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: java.io.BufferedReader@48162477; line: 1, column: 2]","statusCode":400,"briefSummary":"03020018 Could not read content from HTTP request body: Unexpected character ('P' (code 80)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: java.io.BufferedReader@48162477; line: 1, column: 2]","stackTrace":"Por motivos de seguridad, ya no se muestra el seguimiento de la pila, pero se guarda la propiedad para versiones anteriores.","descriptionURL":"&lt;A href="https://api-explorer.alfresco.com" target="_blank" rel="nofollow noopener noreferrer"&gt;https://api-explorer.alfresco.com&lt;/A&gt;"}}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I hope someone can help me. Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2020 15:49:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/i-have-a-issue-when-i-try-send-a-file-to-alfresco/m-p/109012#M30575</guid>
      <dc:creator>viperboys</dc:creator>
      <dc:date>2020-04-02T15:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: I have a issue when i try send a file to Alfresco</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/i-have-a-issue-when-i-try-send-a-file-to-alfresco/m-p/109013#M30576</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;Can't say that I know exactly what's going wrong here, but&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Could not read content from HTTP request body: Unexpected character &lt;/PRE&gt;
&lt;P&gt;suggests that the file is not being sent properly. I'm not sure about the curlopt_httpheader values either - something there doesn't look right to me.&lt;/P&gt;
&lt;P&gt;HTH,&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 14:10:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/i-have-a-issue-when-i-try-send-a-file-to-alfresco/m-p/109013#M30576</guid>
      <dc:creator>EddieMay</dc:creator>
      <dc:date>2020-04-03T14:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: I have a issue when i try send a file to Alfresco</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/i-have-a-issue-when-i-try-send-a-file-to-alfresco/m-p/109014#M30577</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 answering.&lt;/P&gt;&lt;P&gt;My mistake is because I don't send the data well. I have tried it with CURL library and it doesn't work for me.&lt;/P&gt;&lt;P&gt;This is the error&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{"error":{"errorKey":"Required parameters are missing","statusCode":400,"briefSummary":"03030011 Required parameters are missing","stackTrace":"Por motivos de seguridad, ya no se muestra el seguimiento de la pila, pero se guarda la propiedad para versiones anteriores.","descriptionURL":"&lt;A href="https://api-explorer.alfresco.com" target="_blank" rel="nofollow noopener noreferrer"&gt;https://api-explorer.alfresco.com&lt;/A&gt;"}}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can you tell me how is the correct way to send the files?&amp;nbsp;Also useful is a use case with the CURL library for sending files.&amp;nbsp;I have been guided by the code generated by POSTMAN but it has not worked for me either.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 15:14:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/i-have-a-issue-when-i-try-send-a-file-to-alfresco/m-p/109014#M30577</guid>
      <dc:creator>viperboys</dc:creator>
      <dc:date>2020-04-03T15:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: I have a issue when i try send a file to Alfresco</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/i-have-a-issue-when-i-try-send-a-file-to-alfresco/m-p/109015#M30578</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;I've just created the following file upload.php. The code is as follows:&lt;/P&gt;
&lt;PRE&gt;&amp;lt;?php&lt;BR /&gt;
$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_d8b9084ee020e4921687abfd0ce5a1c5ad4efd4f",
  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','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 I got from calling the file (echo $response) is:&lt;/P&gt;
&lt;PRE&gt;{"entry":{"isFile":true,"createdByUser":{"id":"admin","displayName":"Administrator"},&lt;BR /&gt;"modifiedAt":"2020-04-06T16:08:04.943+0000","nodeType":"cm:content",&lt;BR /&gt;"content":{"mimeType":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",&lt;BR /&gt;"mimeTypeName":"Microsoft Word 2007","sizeInBytes":11760,"encoding":"UTF-8"},"parentId":"479ec2bc-fb73-4e93-9c44-b36d08ba0446",&lt;BR /&gt;"aspectNames":["cm:versionable","cm:titled","cm:auditable","cm:author"],"createdAt":"2020-04-06T16:08:04.943+0000",&lt;BR /&gt;"isFolder":false,"modifiedByUser":{"id":"admin","displayName":"Administrator"},&lt;BR /&gt;"name":"Eddie May Upload","id":"bf1ef22f-b759-4cc3-98ca-c68df911b132",&lt;BR /&gt;"properties":{"cm:versionLabel":"1.0","cm:author":"Eddie May",&lt;BR /&gt;"cm:versionType":"MAJOR"}}}&lt;/PRE&gt;
&lt;P&gt;You have to make sure that your alf ticket is fresh - so you 1st need to &lt;A href="https://hub.alfresco.com/t5/ecm-archive/upload-a-file-in-alfresco-repository-using-php-and-curl/m-p/222516#comment-823192" target="_self" rel="nofollow noopener noreferrer"&gt;call the login api to retrieve the ticket&lt;/A&gt; &amp;amp; add that to your curl url. Secondly, you probably need the destination noderef - here I'm just putting the file into my root.&lt;/P&gt;

&lt;P&gt;HTH,&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2020 16:26:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/i-have-a-issue-when-i-try-send-a-file-to-alfresco/m-p/109015#M30578</guid>
      <dc:creator>EddieMay</dc:creator>
      <dc:date>2020-04-06T16:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: I have a issue when i try send a file to Alfresco</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/i-have-a-issue-when-i-try-send-a-file-to-alfresco/m-p/109016#M30579</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 for you helping..&lt;/P&gt;&lt;P&gt;I am using yor code but this is not work for me..&amp;nbsp;It does not generate any error but it does not send the file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What can I do to send the file with CURL?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 02:54:20 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/i-have-a-issue-when-i-try-send-a-file-to-alfresco/m-p/109016#M30579</guid>
      <dc:creator>viperboys</dc:creator>
      <dc:date>2020-04-07T02:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: I have a issue when i try send a file to Alfresco</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/i-have-a-issue-when-i-try-send-a-file-to-alfresco/m-p/109017#M30580</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;Sorry this is not working for you. If there's no log output, we probably have to go back to first principles.&lt;/P&gt;
&lt;P&gt;1) Outside of Wordpress, can you use the api to log into Alfresco - this should return the alf_ticket? Create a simple php file that uses the api to get the alf ticket.&lt;/P&gt;
&lt;P&gt;2) Once that's achieved, build on that to use curl to upload a document - again using a simple php file outside of Wordpress.&lt;/P&gt;
&lt;P&gt;Once you've got that working, you'll then need to integrate into your Wordpress app. Wordpress has its own wrapper classes for curl up &amp;amp; downloading, like wp_remote_post(). You may need to use those rather than curl in my example - see this tutorial about &lt;A href="https://www.curry-software.com/en/blog/wordpress_plugin_development-talking_to_apis/" target="_self" rel="nofollow noopener noreferrer"&gt;calling APIs in Wordpress&lt;/A&gt;. Also (longshot) make sure there is nothing in wp-config.php, etc ., &amp;amp; also see if curl is enabled (phpinfo()).&lt;/P&gt;
&lt;P&gt;At the moment I don't have Wordpress installed on my laptop to test the above in a Wordpress app.&lt;/P&gt;
&lt;P&gt;HTH,&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 11:28:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/i-have-a-issue-when-i-try-send-a-file-to-alfresco/m-p/109017#M30580</guid>
      <dc:creator>EddieMay</dc:creator>
      <dc:date>2020-04-07T11:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: I have a issue when i try send a file to Alfresco</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/i-have-a-issue-when-i-try-send-a-file-to-alfresco/m-p/109018#M30581</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;Hello .. I already managed to solve my problem. I did it with Jquery and it works perfectly.&lt;/P&gt;&lt;P&gt;Thank you..&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 21:08:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/i-have-a-issue-when-i-try-send-a-file-to-alfresco/m-p/109018#M30581</guid>
      <dc:creator>viperboys</dc:creator>
      <dc:date>2020-05-07T21:08:06Z</dc:date>
    </item>
  </channel>
</rss>

