cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We're looking to hear about your experience when using Dropbox in a web browser. What parts of Dropbox feels very slow to you and takes a lot of time to get done? What are you trying to do in the Dropbox web browser when you experience slowness? Tell us right 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: 
1
Ask
2
Reply and help

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
Who's talking

Top contributors to this post

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