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?

DR93
  • 463
  • 6
  • 21
Sam
  • 822
  • 2
  • 8
  • 30
  • 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? – Erwin Bolwidt Jul 30 '17 at 07: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 Jul 30 '17 at 08:41
  • @Loïc Yes. Your observation is correct. – Sam Jul 30 '17 at 08:45
  • [Cross-linking for reference: https://www.dropboxforum.com/t5/API-support/Cannot-auto-rename-file/m-p/234665#M12824 ] – Greg Jul 30 '17 at 20:55

1 Answers1

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.

Sam
  • 822
  • 2
  • 8
  • 30