Hi,
I'm currently making a website that requires multiple images to be downloaded with the dropbox API in one go (up to 300 at a time).
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)
I'm working on making it just put the files into a DB and periodically just update from there but that seems highly inefficient.
Is there a call to fetch multiple files in one go?
My current code:
if($delta['has_more'] == 1){//if new files are present
print_r($delta['has_more']);
foreach($delta['entries'] as $entry){
print_r($entry['0']);
echo '<hr/>';
if($entry['1'] == null){
unlink(basename($entry['0']));
}else{
if($entry['1']['is_dir'] != 1){//if not a directory
//save new file
$path = $entry['1']['path'];
$filename = basename($path);
$output = '/var/www/vhosts/MY/DOMAIN/images/dropbox/'.$filename;
$f = fopen($output, "w+b"); // write to $output
$fileImage = $dbxClient->getFile($path, $f);
fclose($f);
}
}
}
}