cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you an educator? Well we want to hear from you, so check out some tools we think might help you out 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: 

Can't Download File From Dropbox downloadData With Objective-C

Can't Download File From Dropbox downloadData With Objective-C

JoelBarker
Explorer | Level 3

Hello,

 

I am trying to use the following code to download data from Dropbox using the Vs2 API:

 

NSString *filePath = @"/joelLockFolderV2_1489675832.409768.tsl";

[[client.filesRoutes downloadData:filePath] setResponseBlock:^(DBFILESFileMetadata *result, DBFILESDownloadError *routeError, DBRequestError *error, NSData *fileContents) { if (result) { NSLog(@"%@\n", result); NSString *dataStr = [[NSString alloc] initWithData:fileContents encoding:NSUTF8StringEncoding]; NSLog(@"%@\n", dataStr); } else { NSLog(@"%@\n%@\n", routeError, error); } }];

When I try this I receive the following error:

 

2017-03-16 15:58:35.759 xctest[78431:5712864] (null)
DropboxClientError[{
    NSError = "Error Domain=NSURLErrorDomain Code=-1 \"unknown error\" UserInfo={NSErrorFailingURLKey=https://api-content.dropbox.com/2/files/download, NSLocalizedDescription=unknown error, NSErrorFailingURLStringKey=https://api-content.dropbox.com/2/files/download}";
}];

I have checked and the file at filePath exists. I've found that various Api calls correctly work. I am having the same problem with 

 

[client.filesRoutes downloadUrl:filePath overwrite:TRUE destination:ril]

 

And:

 

[[client.filesRoutes uploadUrl:remoteFilePath inputUrl:localURL]

 

I've tried setting 'NSAppTransportSecurity' to Allow Arbitary loads.

 

Is there anything I am missing...?

 

Regards,

 

Joel

 

1 Reply 1

Re: Can't Download File From Dropbox downloadData With Objective-C

Greg-DB
Dropboxer
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?