Our Community is in read-only mode until April 8th, learn more here. You can still search existing threads or get help via Dropbox Support, the Dropbox Help Center, or Learn.
Forum Discussion
蕾雷
9 years agoHelpful | Level 6
Overwrite upload
In Dropbox v2 sdk, the need to cover the replacement of existing documents, how to achieve? Similar to V1's ChunkedUploader.finish (path, parentRev). I use the UploadSessionFinishUploader.uploadAndFi...
Greg-DB
Dropbox Community Moderator
9 years agoWhen you call uploadSessionFinish (to get your UploadSessionFinishUploader), you supply a CommitInfo instance as the commit parameter. That CommitInfo instance should have a mode (a WriteMode) which determines how the file is written. The equivalent to API v1's "parentRev" is to use the update mode where the value is the rev of the parent.
So, that would look something like this:
WriteMode mode = WriteMode.update(parentRev); CommitInfo commit = CommitInfo.newBuilder(dropboxFilePath).withMode(mode).build(); client.files().uploadSessionFinish(cursor, commit).uploadAndFinish(in);
蕾雷
9 years agoHelpful | Level 6
thank you very much!
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
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!