We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Forum Discussion
tannchri
8 years agoExplorer | Level 4
iOS API v2: possible to overwrite files at upload?
I'm using the objective-c SDK for Dropbox API v2 and trying to do something which should be remarkably simple: upload text files to the user's Dropbox folder and if any changes are made to the file o...
- 8 years ago
You can certainly overwrite files using the API. For example, use -uploadData:mode:autorename:clientModified:mute:inputData: and pass in the desired 'mode' parameter, which should be a DBFILESWriteMode. You can use the 'overwrite' mode, but using 'update' with a rev value is safer, as it prevents accidentally overwriting new data the app wasn't aware of.
Greg-DB
8 years agoDropbox Staff
You can certainly overwrite files using the API. For example, use -uploadData:mode:autorename:clientModified:mute:inputData: and pass in the desired 'mode' parameter, which should be a DBFILESWriteMode. You can use the 'overwrite' mode, but using 'update' with a rev value is safer, as it prevents accidentally overwriting new data the app wasn't aware of.
- tannchri8 years agoExplorer | Level 4
Thank you!
Though I'm still having trouble with this, and am unable to find any resolution elsewhere. Is this not the correct way to write this? "
dbclient.filesRoutes uploadData:fileName mode:DBFILESWriteModeOverwrite ..."
- Greg-DB8 years agoDropbox Staff
That woud look like this:
NSString *path = ... NSData *data = ... DBFILESWriteMode *mode = [[DBFILESWriteMode alloc] initWithOverwrite]; [[client.filesRoutes uploadData:path mode:mode autorename:false clientModified:nil mute:false inputData:data] response:^(DBFILESFileMetadata *metadata, DBFILESUploadError *routeError, DBRequestError *error) { if (metadata) { NSLog(@"%@\n", metadata); } else { NSLog(@"%@\n%@\n", routeError, error); } }];
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,876 PostsLatest Activity: 5 hours agoIf 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!