Your workflow is unique 👨‍💻 -  tell us how you use Dropbox here.

Forum Discussion

Christoph L.2's avatar
Christoph L.2
New member | Level 1
10 years ago

V2 API's DbxFiles.WriteMode.update() does not created conflicted copy as promised

I am building a sync client based on the V2 API for Java. The documentation for update() states the following:

"If the rev of the file currently on Dropbox doesn't match revisionToReplace, Dropbox leave the original file alone and save your contents to a new file. For example, if the original file path is "/Notes/Groceries.txt", the new file's path might be "/Notes/Groceries (conflicted copy).txt"."

However, when I actually try this, no conflicted copy is created. The upload throws the following exception:

com.dropbox.core.v2.DbxFiles$UploadException: Exception in upload: UploadError.{".tag":"path","reason":{".tag":"conflict","conflict":{".tag":"file"}},"upload_session_id":"..."}

I could of course handle the conflict myself. But is there a way to make update() behave according to specs?

 

2 Replies

Replies have been turned off for this discussion
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    Are you setting .autorename(true)? You'll need to do so for it to create the conflicted copy. By default, or if you set .autorename(false), it'll yield the error instead.

  • Christoph L.5's avatar
    Christoph L.5
    New member | Level 1
    10 years ago

    That did the trick (and now I also understand that part of the documentation). Thanks!

About Dropbox API Support and Feedback

Node avatar for 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!