cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Emma uses to-do lists to get it all done here!

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Download array of images in APIv2 Ios objectie c`

Download array of images in APIv2 Ios objectie c`

katharina
Explorer | Level 3

HI support, How i can download the array of image from drobox using apiv2in IOS objective c. 

 

I am using below code taht download only one Image from the droppbox.

 

NSFileManager *fileManager = [NSFileManager defaultManager];
    NSURL *outputDirectory = [fileManager URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask][0];
    NSURL *outputUrl = [outputDirectory URLByAppendingPathComponent:@"Image.jpg"];
    
    [[[client.filesRoutes downloadUrl:@"/Test1/Image2.jpg" overwrite:YES destination:outputUrl]
      setResponseBlock:^(DBFILESFileMetadata *result, DBFILESDownloadError *routeError, DBRequestError *networkError,
                         NSURL *destination) {
          if (result)
          {
              NSLog(@"%@\n", result);
              NSData *data = [[NSFileManager defaultManager] contentsAtPath:[destination path]];
              NSString *dataStr = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
              NSLog(@"%@\n", dataStr);
          } else
          {
              NSLog(@"%@\n%@\n", routeError, networkError);
          }
      }] setProgressBlock:^(int64_t bytesDownloaded, int64_t totalBytesDownloaded, int64_t totalBytesExpectedToDownload)
    {
          NSLog(@"%lld\n%lld\n%lld\n", bytesDownloaded, totalBytesDownloaded, totalBytesExpectedToDownload);
      }];

 

1 Reply 1

Re: Download array of images in APIv2 Ios objectie c`

Greg-DB
Dropboxer
The download methods, such as the downloadUrl method you're using, enable you to download a single specified file. The API doesn't offer a way to download files in bulk, so to download multiple files, you should loop through and call the download method for each one you need. (You'll probably want to limit how many you download concurrently though.)
Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?