Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Would just like to know if there is a batch download method available.
I have looked through the api but it doesn't seem to exist
And if its not. is a recursive download for batch files the optimal way to download batches of files?
-(void)recursiveDownload:(NSMutableArray<DBFILESMetadata *>*)array position:(int)position hasErrors:(BOOL)hasErrors {
if (array.count == 0) {
[self downloadCompletedAlert];
return;
}
NSString* name = array[position].name;
NSString* photoDropboxPath = [NSString stringWithFormat:@"/%@",name];
NSURL* photoURLPath = [[WCPURLHelper applicationPhotoDirectory]URLByAppendingPathComponent:name isDirectory:NO];
[[_dbUserClient.filesRoutes downloadUrl: photoDropboxPath overwrite:YES destination:photoURLPath]
setResponseBlock:^(DBFILESFileMetadata *result, DBFILESDownloadError *routeError, DBRequestError *networkError,
NSURL *destination) {
BOOL hasError = hasErrors;
if (!result) {
NSLog(@"%@\n%@\n", routeError, networkError);
hasError = true;
}
_progressHUD.detailsLabelText = [NSString stringWithFormat:@"Downloading Photo %d of %zd",position+1,array.count];
if (position+1 == array.count) {
if (hasError) {
[self failedAlertWithDetailLabelText:@"Download Failed" title:@"Photos were not all downloaded" message:@"There were errors downloading from dropbox"];
} else {
[self downloadCompletedAlert];
}
} else {
//stops dropbox from giving the error that there are too many write actions happening
//gives time between photos
[self recursiveDownload:array position:position+1 hasErrors:hasError];
}
}];
}
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!