Objective-C API Question
Previously when I uploaded files (old API) dropbox would create numbered versions if the file was already there.
I am trying to do this same thing using the "uploadData" file route, like this:
DBFILESWriteMode *mode = [[DBFILESWriteMode alloc] initWithUpdate:parentRev];
// parentRev is null here, what should it be ?
[[client.filesRoutes uploadData:[path stringByAppendingPathComponent:name] mode:mode autorename:false clientModified:nil mute:false inputData:data]
setResponseBlock:^(DBFILESFileMetadata *metadata, DBFILESUploadError *routeError, DBRequestError *networkError) {
if (metadata) {
[self uploadedFile:[path stringByAppendingPathComponent:name] from:localFileURL.absoluteString metadata:metadata];
} else {
[self uploadFileFailedWithRouteError:routeError andNetworkError:networkError];
}
}];
This always fails, with the error message:
2018-01-12 16:50:45.010 Shot Lister[93699:4378867] There was an error uploading the file
RouteError - (null)
NetworkError - DropboxBadInputError[{
ErrorContent = "Error in call to API function \"files/upload\": HTTP header \"Dropbox-API-Arg\": mode: missing 'update' key";
RequestId = 80a4b8c090dd70cb191ff3182e76c4e1;
StatusCode = 400;
UserMessage = nil;
}];
If I initWithOverWrite it works just fine.
""