We're making changes to the Community, so you may have received some notifications - thanks for your patience and welcome back. Learn more here.

Forum Discussion

Christoph L.2's avatar
Christoph L.2
New member | Level 1
9 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?

 

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    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

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

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,875 PostsLatest Activity: 52 minutes ago
325 Following

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 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!