We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
AppleGG
9 years agoHelpful | Level 6
iOS Objective C. up/download URL.
I can't seem to get the right response block for these. A little Help? Also one parameter is labeled as a URL but takes a string, which I assume is a path. Your web page examples on file tran...
Greg-DB
Dropbox Community Moderator
9 years agoIt sounds like you're referring to uploadUrl and downloadUrl. The documentation there has more information, but the first parameter to each is the remote path in Dropbox (that is, the path where you want to upload to or download from, respectively.) The URL parameter is likewise the file URL to upload from or download to, respectively.
Here are some examples of what those would look like:
[[client.filesRoutes uploadUrl:@"/test.txt" inputUrl:[NSURL fileURLWithPath:@"/local/path/to/test.txt"]]
setResponseBlock:^(DBFILESFileMetadata *metadata, DBFILESUploadError *uploadError, DBRequestError *error) {
if (metadata) {
NSLog(@"The upload completed successfully.");
NSLog(@"File metadata:");
NSLog(@"%@", metadata);
} else if (uploadError) {
NSLog(@"Something went wrong with the upload:");
NSLog(@"%@", uploadError);
} else if (error) {
NSLog(@"Something went wrong with the API call:");
NSLog(@"%@", error);
}
}];
[[client.filesRoutes downloadUrl:@"/test.txt" overwrite:true destination:[NSURL fileURLWithPath:@"/local/path/to/test.txt"]]
setResponseBlock:^(DBFILESFileMetadata *metadata, DBFILESDownloadError *downloadError, DBRequestError *error, NSURL *destination) {
if (metadata) {
NSLog(@"The download call completed successfully.");
NSLog(@"File metadata:");
NSLog(@"%@", metadata);
} else if (downloadError) {
NSLog(@"Something went wrong with the download:");
NSLog(@"%@", downloadError);
} else if (error) {
NSLog(@"Something went wrong with the API call:");
NSLog(@"%@", error);
}
}];
If this isn't working for you, can you share the code that isn't working for you and the error you're getting?
Bob S.15
8 years agoCollaborator | Level 9
I'm getting an "unrecognized selector sent to instance" for uploadURL. Trying to update to newest SDK from the old one that supported iOS 8. Those links you posted are broken. Is uploadURL gone? What's its replacement???
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
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!