We Want to Hear From You! What Do You Want to See on the Community? Tell us here!
Forum Discussion
bliss
9 years agoExplorer | Level 3
upload image using apiv2 in iOS idk using objective c
How i can upload image usign objective c. I am using APIV2.
And i implemted it which display me an error. Test 1 root folder here. I want to image uplaod in this folder
NSData *fileData = [@"water.jpg" dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:NO]; [[[client.filesRoutes uploadData:@"/Test1/" inputData:fileData] setResponseBlock:^(DBFILESFileMetadata *result, DBFILESUploadError *routeError, DBRequestError *networkError) { if (result) { NSLog(@"%@\n", result); } else { NSLog(@"%@\n%@\n", routeError, networkError); } }] setProgressBlock:^(int64_t bytesUploaded, int64_t totalBytesUploaded, int64_t totalBytesExpectedToUploaded) { NSLog(@"\n%lld\n%lld\n%lld\n", bytesUploaded, totalBytesUploaded, totalBytesExpectedToUploaded); }];
ERROR----
DropboxBadInputError[{ ErrorContent = "Error in call to API function \"files/upload\": path: invalid path: paths must not have a trailing \"/\""; RequestId = 9576332b860df94c12bcc13a28a6877a; StatusCode = 400; UserMessage = nil; }];
- This error message is expected in this case, as the file path you supply can't end with a "/", as yours does (@"/Test1/"). When uploading, you should supply the full path, including file name. You probably meant to supply something like @"/Test1/water.jpg" instead.
1 Reply
Replies have been turned off for this discussion
- Greg-DB9 years ago
Dropbox Community Moderator
This error message is expected in this case, as the file path you supply can't end with a "/", as yours does (@"/Test1/"). When uploading, you should supply the full path, including file name. You probably meant to supply something like @"/Test1/water.jpg" instead.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,036 PostsLatest Activity: 3 hours ago
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 or Facebook.
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!