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 on the device, upload those changes.
However, I'm running into a strategic issue wherein the code refuses to overwrite an existing file. So if a user opens a file on their device, makes a change, I want that change to be pushed to their Dropbox. What's the best way to make this happen? I don't see anything about overwriting files for uploads or updating existing documents.
Using the basic upload code currently:
[[[dbclient.filesRoutes uploadData:[NSString stringWithFormat:@/%@", fileName] inputData:fileData]
response:^(DBFILESFileMetadata *result, DBFILESUploadError *routeError, DBRequestError *error)
Is there an easy way to force overwrites? It would be nice to not have to loop through the Dropbox folder and check if the file currently exists before updating it.
What I'd like to do is simply upload the file, and if it already exists just overwrite it. Is this not possible? Am I going about this incorrectly?