<?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: PPTX corrupted when uploading in php (chunk) in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/PPTX-corrupted-when-uploading-in-php-chunk/m-p/213774#M10883</link>
    <description>&lt;P&gt;It looks like you're using a third party library for connecting to the&amp;nbsp;Dropbox API, so I'm afraid I can't offer much insight on that. We can't support third party libraries themselves as we didn't make them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That said, when uploading to the&amp;nbsp;Dropbox API, the file type doesn't make a difference really. The&amp;nbsp;Dropbox API will accept whatever raw data you give it. I suspect there's just an issue with the code you're using to make the upload calls. I&amp;nbsp;recommend adding some logging or stepping through with a debugger to see where/when it's not doing what you expect. (E.g., perhaps you're missing a chunk, or the chunks or out of order, etc.) You can also inspect the uploaded file itself to get some hints. (E.g., is the uploaded file larger or smaller than expected, etc.)&lt;/P&gt;</description>
    <pubDate>Wed, 29 Mar 2017 11:27:24 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2017-03-29T11:27:24Z</dc:date>
    <item>
      <title>PPTX corrupted when uploading in php (chunk)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/PPTX-corrupted-when-uploading-in-php-chunk/m-p/213746#M10882</link>
      <description>&lt;P&gt;Uploading a 'pptx' file divided into parts through the Dropbox API is corrupted.&lt;BR /&gt;Does anyone have a solution to this problem?&lt;BR /&gt;Thank you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;$dropboxAdapter = new DropboxStorageRepository();
$file = $request-&amp;gt;file("file");
$chunk = (int) $request-&amp;gt;get('chunk', false);
$chunks = (int) $request-&amp;gt;get('chunks', false);
$originalName = $request-&amp;gt;get('name');
$dir_move = utf8_encode ($request-&amp;gt;headers-&amp;gt;get("current-dir"));

if($chunk == 0){
&amp;nbsp; &amp;nbsp; &amp;nbsp;$id = $dropboxAdapter-&amp;gt;client-&amp;gt;chunkedUploadStart(File::get($file));

&amp;nbsp; &amp;nbsp; &amp;nbsp;session::forget("fid");
&amp;nbsp; &amp;nbsp; &amp;nbsp;session::forget("bof");
&amp;nbsp; &amp;nbsp; &amp;nbsp;Session::set("fid", $id);
&amp;nbsp; &amp;nbsp; &amp;nbsp;Session::set("bof", $file-&amp;gt;getSize());
}
if($chunk &amp;gt; 0 &amp;amp;&amp;amp; $chunk &amp;lt; $chunks - 1){

&amp;nbsp; &amp;nbsp; &amp;nbsp;$bytesOffset = Session::get("bof");
&amp;nbsp; &amp;nbsp; &amp;nbsp;$id = Session::get("fid");
&amp;nbsp; &amp;nbsp; &amp;nbsp;$dropboxAdapter-&amp;gt;client-&amp;gt;chunkedUploadContinue($id,$bytesOffset,File::get($file));
&amp;nbsp; &amp;nbsp; &amp;nbsp;Session::set("bof",$bytesOffset+$file-&amp;gt;getSize());

}
if ($chunk == $chunks - 1) {
&amp;nbsp; &amp;nbsp; $bytesOffset = Session::get("bof");
&amp;nbsp; &amp;nbsp; $id = Session::get("fid");
&amp;nbsp; &amp;nbsp; $dropboxAdapter-&amp;gt;client-&amp;gt;chunkedUploadContinue($id,$bytesOffset,File::get($file));

&amp;nbsp; &amp;nbsp; $file_dropbox = $dropboxAdapter-&amp;gt;client-&amp;gt;chunkedUploadFinish($id,$dir_move."/".$originalName,WriteMode::force());
/
&amp;nbsp; &amp;nbsp; $saveFile = $this-&amp;gt;SaveFile($file_dropbox);
&amp;nbsp; &amp;nbsp; session::forget("fid");
&amp;nbsp; &amp;nbsp; session::forget("bof");
}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:24:19 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/PPTX-corrupted-when-uploading-in-php-chunk/m-p/213746#M10882</guid>
      <dc:creator>Raul S.7</dc:creator>
      <dc:date>2019-05-29T09:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: PPTX corrupted when uploading in php (chunk)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/PPTX-corrupted-when-uploading-in-php-chunk/m-p/213774#M10883</link>
      <description>&lt;P&gt;It looks like you're using a third party library for connecting to the&amp;nbsp;Dropbox API, so I'm afraid I can't offer much insight on that. We can't support third party libraries themselves as we didn't make them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That said, when uploading to the&amp;nbsp;Dropbox API, the file type doesn't make a difference really. The&amp;nbsp;Dropbox API will accept whatever raw data you give it. I suspect there's just an issue with the code you're using to make the upload calls. I&amp;nbsp;recommend adding some logging or stepping through with a debugger to see where/when it's not doing what you expect. (E.g., perhaps you're missing a chunk, or the chunks or out of order, etc.) You can also inspect the uploaded file itself to get some hints. (E.g., is the uploaded file larger or smaller than expected, etc.)&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 11:27:24 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/PPTX-corrupted-when-uploading-in-php-chunk/m-p/213774#M10883</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-03-29T11:27:24Z</dc:date>
    </item>
  </channel>
</rss>

