1

I'm using Dropbox Java API to upload file.

Following code does not upload file with auto rename:

void uploadFile(@NonNull final String inPath, @NonNull final InputStream inputStream) throws IOException, DbxException {
    client.files()
        .uploadBuilder(inPath)
        .withMode(WriteMode.ADD)
        .withAutorename(true)
        .uploadAndFinish(inputStream);
}

Can you please suggest what am I doing wrong?

4
  • What is your question? Does does code work or does it not work? If it doesn't work, what did you expect to happen and what happened instead? Commented Jul 30, 2017 at 7:49
  • 1
    Are you sending twice the same file? I have observed the same thing when doing so, using two different files solved that issue.
    – Loïc
    Commented Jul 30, 2017 at 8:41
  • @Loïc Yes. Your observation is correct.
    – Sam
    Commented Jul 30, 2017 at 8:45
  • [Cross-linking for reference: dropboxforum.com/t5/API-support/Cannot-auto-rename-file/m-p/… ]
    – Greg
    Commented Jul 30, 2017 at 20:55

1 Answer 1

3

The answer is that: Dropbox does not consider there to be a conflict if you upload content identical to what's already in that file, and the rename will only occur on conflict.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.