<?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 Multiple getFile - PHP in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Multiple-getFile-PHP/m-p/132815#M3932</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'm currently making a website that requires multiple images to be downloaded with the dropbox API in one go (up &amp;nbsp;to 300 at a time).&lt;/P&gt;
&lt;P&gt;Currently I am using this code, however I only ever seem to be able to download 46 images at a time before it stops. (I even tried upping max execution time)&lt;/P&gt;
&lt;P&gt;I'm working on making it just put the files into a DB and periodically just update from there but that seems highly inefficient.&lt;/P&gt;
&lt;P&gt;Is there a call to fetch multiple files in one go?&lt;/P&gt;
&lt;P&gt;My current code:&lt;/P&gt;
&lt;PRE&gt;if($delta['has_more'] == 1){//if new files are present&lt;BR /&gt; print_r($delta['has_more']);&lt;BR /&gt; foreach($delta['entries'] as $entry){&lt;BR /&gt; print_r($entry['0']);&lt;BR /&gt; echo '&amp;lt;hr/&amp;gt;';&lt;BR /&gt; if($entry['1'] == null){&lt;BR /&gt; unlink(basename($entry['0']));&lt;BR /&gt; }else{&lt;BR /&gt; if($entry['1']['is_dir'] != 1){//if not a directory&lt;BR /&gt; //save new file&lt;BR /&gt; $path = $entry['1']['path'];&lt;BR /&gt; $filename = basename($path);&lt;BR /&gt; $output = '/var/www/vhosts/MY/DOMAIN/images/dropbox/'.$filename;&lt;BR /&gt; $f = fopen($output, "w+b"); // write to $output&lt;BR /&gt; $fileImage = $dbxClient-&amp;gt;getFile($path, $f);&lt;BR /&gt; fclose($f);&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt;}&lt;/PRE&gt;</description>
    <pubDate>Wed, 29 May 2019 09:39:07 GMT</pubDate>
    <dc:creator>Roshan B.1</dc:creator>
    <dc:date>2019-05-29T09:39:07Z</dc:date>
    <item>
      <title>Multiple getFile - PHP</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Multiple-getFile-PHP/m-p/132815#M3932</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'm currently making a website that requires multiple images to be downloaded with the dropbox API in one go (up &amp;nbsp;to 300 at a time).&lt;/P&gt;
&lt;P&gt;Currently I am using this code, however I only ever seem to be able to download 46 images at a time before it stops. (I even tried upping max execution time)&lt;/P&gt;
&lt;P&gt;I'm working on making it just put the files into a DB and periodically just update from there but that seems highly inefficient.&lt;/P&gt;
&lt;P&gt;Is there a call to fetch multiple files in one go?&lt;/P&gt;
&lt;P&gt;My current code:&lt;/P&gt;
&lt;PRE&gt;if($delta['has_more'] == 1){//if new files are present&lt;BR /&gt; print_r($delta['has_more']);&lt;BR /&gt; foreach($delta['entries'] as $entry){&lt;BR /&gt; print_r($entry['0']);&lt;BR /&gt; echo '&amp;lt;hr/&amp;gt;';&lt;BR /&gt; if($entry['1'] == null){&lt;BR /&gt; unlink(basename($entry['0']));&lt;BR /&gt; }else{&lt;BR /&gt; if($entry['1']['is_dir'] != 1){//if not a directory&lt;BR /&gt; //save new file&lt;BR /&gt; $path = $entry['1']['path'];&lt;BR /&gt; $filename = basename($path);&lt;BR /&gt; $output = '/var/www/vhosts/MY/DOMAIN/images/dropbox/'.$filename;&lt;BR /&gt; $f = fopen($output, "w+b"); // write to $output&lt;BR /&gt; $fileImage = $dbxClient-&amp;gt;getFile($path, $f);&lt;BR /&gt; fclose($f);&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt;}&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 May 2019 09:39:07 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Multiple-getFile-PHP/m-p/132815#M3932</guid>
      <dc:creator>Roshan B.1</dc:creator>
      <dc:date>2019-05-29T09:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple getFile - PHP</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Multiple-getFile-PHP/m-p/132816#M3933</link>
      <description>&lt;P&gt;No, there's no API method to download multiple files in a single request.&lt;/P&gt;
&lt;P&gt;What do you&amp;nbsp;mean when you say "it stops"? Is there some sort of error?&lt;/P&gt;
&lt;P&gt;The first line of this code seems wrong...&amp;nbsp;has_more means there will be more entries if you call delta again. I also don't see&amp;nbsp;the loop where you're&amp;nbsp;calling delta for&amp;nbsp;more&amp;nbsp;entries.&lt;/P&gt;
&lt;P&gt;The logic should be something like this (pseudocode):&lt;/P&gt;
&lt;PRE&gt;has_more = true&lt;BR /&gt;while(has_more)&lt;BR /&gt; result = delta()&lt;BR /&gt; has_more = result['has_more']&lt;BR /&gt; process_entries(result.entries)&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Oct 2015 00:21:17 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Multiple-getFile-PHP/m-p/132816#M3933</guid>
      <dc:creator>Steve M.</dc:creator>
      <dc:date>2015-10-23T00:21:17Z</dc:date>
    </item>
  </channel>
</rss>

