cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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

Greg-DB
Dropbox Staff
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?