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...
tslanina
9 years agoNew member | Level 2
Hey,
Your example contains:
inputUrl:[NSURL fileURLWithPath:@"/local/path/to/test.txt"
But when you check DBFILESUserAuthRoutes, there's :
- (DBUploadTask *)uploadUrl:(NSString *)path inputUrl:(NSString *)inputUrl
So, the inputUrl argument is an NSString, not NSURL type.
Moreover, uploadUrl calls requestUpload, where the inputUrl (named as input) is converted to NSURL:
- (DBUploadTaskImpl *)requestUpload:(DBRoute *)route arg:(id<DBSerializable>)arg inputUrl:(NSString *)input {
NSURL *inputUrl = [NSURL fileURLWithPath:input];
So, reasuming. Direct file path ( NSString*) should be passed to uploadUrl, not the URL.
The "inputUrl" name is also misleading (probably leftover from previous version??), should be inputPath, so
inputUrl:(NSURL *)inputUrl
or
inputPath:(NSString *)inputUrl
Would be much better.
The same problem is with other args with "Url" in name abd NSString* type.
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!