We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
ankur
9 years agoNew member | Level 2
API v2 upload file with DBFILESWriteModeAdd not working
Hello,
I am using API v2 iOS sdk for upload files from my device. I want to add new files every time is file already exist. thats why i am using DBFILESWriteModeAdd for upload. But its not create new fileor even replace. I got success message after upload. Here is my code.
DBUserClient *client = [DBClientsManager authorizedClient];
DBFILESWriteMode *mode = [[DBFILESWriteMode alloc] initWithOverwrite];
NSString *destDir = @"/text.m4a"
DBUploadTask *restClient = [[[client.filesRoutes uploadData:destDir
mode:mode
autorename:@(YES)
clientModified:nil
mute:@(NO)
inputData:fileData]
setResponseBlock:^(DBFILESFileMetadata *result, DBFILESUploadError *routeError, DBRequestError *networkError) {
if (result)
{
}
else
{
}
}] setProgressBlock:^(int64_t bytesUploaded, int64_t totalBytesUploaded, int64_t totalBytesExpectedToUploaded)
{
});
}];1 Reply
- Greg-DB9 years ago
Dropbox Community Moderator
Are you uploading the same data again? If the data is exactly the same as what already exists at the destination path, no conflict will occur and it won't create a renamed copy.
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!