<?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: Issue with cURL using https://api.dropboxapi.com/2/files/save_url  endpoint in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-with-cURL-using-https-api-dropboxapi-com-2-files-save-url/m-p/237009#M13085</link>
    <description>&lt;P&gt;I just tried the API call code you shared here, and it successfully saved a full 52KB .png file to my account. The code seems fine, except for the double '/' in the path parameter, though that shouldn't matter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What data is in the 860 byte file that gets saved for you? Try downloading and opening it. E.g., it might contain a response from your client's website different than what you expected. In that case you'd need to investigate why the client's website isn't returning what you expect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that's not the issue, please share a sample URL that reproduces the issue so we can look into it. (Feel free to reply on your ticket instead if you want to share it privately.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(By the way, you can use &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-upload" target="_self"&gt;/2/files/upload&lt;/A&gt;&amp;nbsp;to upload the file data directly if you'd prefer, instead of providing a URL. There's &lt;A href="https://stackoverflow.com/documentation/dropbox-api/409/uploading-a-file/1354/uploading-a-file-via-curl-in-php#t=201708151536531224356" target="_self"&gt;a sample of using that in PHP via curl here&lt;/A&gt;.)&lt;/P&gt;</description>
    <pubDate>Tue, 15 Aug 2017 15:37:43 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2017-08-15T15:37:43Z</dc:date>
    <item>
      <title>Issue with cURL using https://api.dropboxapi.com/2/files/save_url  endpoint</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-with-cURL-using-https-api-dropboxapi-com-2-files-save-url/m-p/236914#M13080</link>
      <description>&lt;P&gt;I'm building a small app for a client to backup critical files dropbox. This is happening simultaneously as certain are uploaded to the client's website. Specifically, the files are .jpg, and .png files.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue that I'm having is that the files are 'uploading', but the uploaded files are only about 860 bytes on DropBox. I've been banging my head against the wall for over 8 hours, and can't find anything but the most scant documentation about this functionality. Below is the code I'm using. The file path and file names come from the file upload, and I have verfied that the image is fully uploaded / moved before proceeding with uploading the file to DropBox.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;?php
$path = getcwd();
$file_location = $path.'/images/'.$filename;
		
clearstatcache(); // Clear file stats to ensure accurate info
$filesize = filesize($file_location); 

// Conditional to make sure the complete file is there
if($filesize &amp;gt;= $_FILES["fichier"]["size"]){

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://api.dropboxapi.com/2/files/save_url");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"path\": \"/images//".$filename."\",\"url\": \"http://www.ClientsWebsiteUrl.com/images/".$filename."\"}");
curl_setopt($ch, CURLOPT_POST, 1);


$headers = array();
$headers[] = "Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
$headers[] = "Content-Type: application/json";
//
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error '.curl_error($ch);
}else{
	echo 'File Uploaded to DropBox';
}
curl_close ($ch);
}
?&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm hoping for any help I can get here, as I am out of ideas. Thanks everyone!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:19:59 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-with-cURL-using-https-api-dropboxapi-com-2-files-save-url/m-p/236914#M13080</guid>
      <dc:creator>bsha100</dc:creator>
      <dc:date>2019-05-29T09:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with cURL using https://api.dropboxapi.com/2/files/save_url  endpoint</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-with-cURL-using-https-api-dropboxapi-com-2-files-save-url/m-p/237009#M13085</link>
      <description>&lt;P&gt;I just tried the API call code you shared here, and it successfully saved a full 52KB .png file to my account. The code seems fine, except for the double '/' in the path parameter, though that shouldn't matter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What data is in the 860 byte file that gets saved for you? Try downloading and opening it. E.g., it might contain a response from your client's website different than what you expected. In that case you'd need to investigate why the client's website isn't returning what you expect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that's not the issue, please share a sample URL that reproduces the issue so we can look into it. (Feel free to reply on your ticket instead if you want to share it privately.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(By the way, you can use &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-upload" target="_self"&gt;/2/files/upload&lt;/A&gt;&amp;nbsp;to upload the file data directly if you'd prefer, instead of providing a URL. There's &lt;A href="https://stackoverflow.com/documentation/dropbox-api/409/uploading-a-file/1354/uploading-a-file-via-curl-in-php#t=201708151536531224356" target="_self"&gt;a sample of using that in PHP via curl here&lt;/A&gt;.)&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2017 15:37:43 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-with-cURL-using-https-api-dropboxapi-com-2-files-save-url/m-p/237009#M13085</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-08-15T15:37:43Z</dc:date>
    </item>
  </channel>
</rss>

