<?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: My uploaded files on Dropbox are 0 bytes/ empty. in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Re-My-uploaded-files-on-Dropbox-are-0-bytes-empty/m-p/538724#M25859</link>
    <description>&lt;P&gt;Thanks Sometimes this code not working and a blank file with 0kb is uploaded on dropbox sever.&lt;/P&gt;</description>
    <pubDate>Wed, 11 Aug 2021 10:46:36 GMT</pubDate>
    <dc:creator>sunshine_sai</dc:creator>
    <dc:date>2021-08-11T10:46:36Z</dc:date>
    <item>
      <title>Re: My uploaded files on Dropbox are 0 bytes/ empty.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Re-My-uploaded-files-on-Dropbox-are-0-bytes-empty/m-p/523170#M25453</link>
      <description>&lt;P&gt;I am uploading files using API v2 in php and getting the same issue with some selected files or file type, can you help me?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 May 2021 19:17:50 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Re-My-uploaded-files-on-Dropbox-are-0-bytes-empty/m-p/523170#M25453</guid>
      <dc:creator>sunshine_sai</dc:creator>
      <dc:date>2021-05-31T19:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: My uploaded files on Dropbox are 0 bytes/ empty.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Re-My-uploaded-files-on-Dropbox-are-0-bytes-empty/m-p/523288#M25456</link>
      <description>&lt;P&gt;I'll be happy to help with any issues you're having with the Dropbox API, but I'll need some more information. Please reply with:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;the name and version number of the platform and SDK/library you are using, if any&lt;/LI&gt;
&lt;LI&gt;the steps to reproduce the issue, including relevant code snippet(s), but don't include any access token(s)&lt;/LI&gt;
&lt;LI&gt;the full text of any error or unexpected output&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Fri, 28 May 2021 17:09:05 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Re-My-uploaded-files-on-Dropbox-are-0-bytes-empty/m-p/523288#M25456</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2021-05-28T17:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: My uploaded files on Dropbox are 0 bytes/ empty.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Re-My-uploaded-files-on-Dropbox-are-0-bytes-empty/m-p/523390#M25464</link>
      <description>&lt;P&gt;$fileURL = '&lt;A href="http://localhost/wordpress/wp-content/uploads/2021/05/my-file.txt" target="_blank" rel="noopener"&gt;http://localhost/wordpress/wp-content/uploads/2021/05/my-file.txt&lt;/A&gt;';&lt;/P&gt;&lt;P&gt;$tempFilePath = basename($fileURL);&lt;/P&gt;&lt;P&gt;try{&lt;BR /&gt;$path = $tempFilePath;&lt;BR /&gt;$fp = fopen($path, 'rb');&lt;BR /&gt;$size = filesize($path);&lt;BR /&gt;&lt;BR /&gt;$cheaders = array('Authorization: Bearer &amp;lt;ACCESS_TOKEN&amp;gt;',&lt;BR /&gt;'Content-Type: application/octet-stream',&lt;BR /&gt;'Dropbox-API-Arg: {"path":"/'.$path.'", "mode":"add"}');&lt;/P&gt;&lt;P&gt;$ch = curl_init('&lt;A href="https://content.dropboxapi.com/2/files/upload" target="_blank" rel="noopener"&gt;https://content.dropboxapi.com/2/files/upload&lt;/A&gt;');&lt;BR /&gt;curl_setopt($ch, CURLOPT_HTTPHEADER, $cheaders);&lt;BR /&gt;curl_setopt($ch, CURLOPT_PUT, true);&lt;BR /&gt;curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');&lt;BR /&gt;curl_setopt($ch, CURLOPT_INFILE, $fp);&lt;BR /&gt;curl_setopt($ch, CURLOPT_INFILESIZE, $size);&lt;BR /&gt;curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);&lt;BR /&gt;$resp = curl_exec($ch);&lt;BR /&gt;curl_close($ch);&lt;BR /&gt;fclose($fp);&lt;BR /&gt;&lt;BR /&gt;$jsonData= $resp; // put here your json object&lt;BR /&gt;$arrayData = json_decode($jsonData, true);&lt;BR /&gt;if($arrayData['size'] != 0 ){&lt;BR /&gt;&lt;BR /&gt;print_r($arrayData);&lt;BR /&gt;// Removed file from this server atfer moved in dropbox Storage.&lt;BR /&gt;wp_delete_attachment($dt['upload_file_id'] );&lt;/P&gt;&lt;P&gt;$response = array('status' =&amp;gt; 'success');&lt;BR /&gt;$response['success'] = true;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting this output:-&lt;/P&gt;&lt;P&gt;array printed:&lt;/P&gt;&lt;P&gt;Array&lt;BR /&gt;(&lt;BR /&gt;[name] =&amp;gt; my-file.txt&lt;BR /&gt;[path_lower] =&amp;gt; /my-file.txt&lt;BR /&gt;[path_display] =&amp;gt; /my-file.txt&lt;BR /&gt;[id] =&amp;gt; id:B5l9vJBpsTAAAAAAAAAAbQ&lt;BR /&gt;[client_modified] =&amp;gt; 2021-05-28T11:30:07Z&lt;BR /&gt;[server_modified] =&amp;gt; 2021-05-28T11:30:07Z&lt;BR /&gt;[rev] =&amp;gt; 015c36232ad2ec4000000019de99780&lt;BR /&gt;[size] =&amp;gt; 0&lt;BR /&gt;[is_downloadable] =&amp;gt; 1&lt;BR /&gt;[content_hash] =&amp;gt; 1dc1597f40484ade184602a580c89f61adcedf3c5be81c74e31748ba36f2d5b9&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Response which I am getting :&lt;/P&gt;&lt;P&gt;{"status":"success","success":true,"dtarray":"{\"name\": \"s12-compressor.jpg\", \"path_lower\": \"\/s12-compressor.jpg\", \"path_display\": \"\/s12-compressor.jpg\", \"id\": \"id:B5l9vJBpsTAAAAAAAAAAbQ\", \"client_modified\": \"2021-05-28T11:30:07Z\", \"server_modified\": \"2021-05-28T11:30:07Z\", \"rev\": \"015c36232ad2ec4000000019de99780\", \"size\": 0, \"is_downloadable\": true, \"content_hash\": \"1dc1597f40484ade184602a580c89f61adcedf3c5be81c74e31748ba36f2d5b9\"}"}&lt;/P&gt;</description>
      <pubDate>Sat, 29 May 2021 07:11:00 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Re-My-uploaded-files-on-Dropbox-are-0-bytes-empty/m-p/523390#M25464</guid>
      <dc:creator>sunshine_sai</dc:creator>
      <dc:date>2021-05-29T07:11:00Z</dc:date>
    </item>
    <item>
      <title>Re: My uploaded files on Dropbox are 0 bytes/ empty.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Re-My-uploaded-files-on-Dropbox-are-0-bytes-empty/m-p/523761#M25476</link>
      <description>&lt;P&gt;I just gave this a try myself, plugging in my own access token and local file path, and it successfully uploaded a non-empty file as expected for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should check that your local file is non-empty and is being accessed successfully. For instance, check what the value of "$size" is for you, and make sure your "$fileURL", "$tempFilePath", and "$path" values are correct.&lt;/P&gt;</description>
      <pubDate>Mon, 31 May 2021 15:18:48 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Re-My-uploaded-files-on-Dropbox-are-0-bytes-empty/m-p/523761#M25476</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2021-05-31T15:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: My uploaded files on Dropbox are 0 bytes/ empty.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Re-My-uploaded-files-on-Dropbox-are-0-bytes-empty/m-p/538724#M25859</link>
      <description>&lt;P&gt;Thanks Sometimes this code not working and a blank file with 0kb is uploaded on dropbox sever.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 10:46:36 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Re-My-uploaded-files-on-Dropbox-are-0-bytes-empty/m-p/538724#M25859</guid>
      <dc:creator>sunshine_sai</dc:creator>
      <dc:date>2021-08-11T10:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: My uploaded files on Dropbox are 0 bytes/ empty.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Re-My-uploaded-files-on-Dropbox-are-0-bytes-empty/m-p/538782#M25861</link>
      <description>&lt;P&gt;Have you checked the suggestions in my last message?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 15:29:22 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Re-My-uploaded-files-on-Dropbox-are-0-bytes-empty/m-p/538782#M25861</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2021-08-11T15:29:22Z</dc:date>
    </item>
  </channel>
</rss>

