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: 

API v2 upload file with DBFILESWriteModeAdd not working

API v2 upload file with DBFILESWriteModeAdd not working

ankur
New member | Level 2

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 1

Greg-DB
Dropbox Staff
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.
Need more support?
Who's talking

Top contributors to this post

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