V
V
vbNoName2018-03-15 20:14:12
Java
vbNoName, 2018-03-15 20:14:12

How to upload a file to Dropbox if the name already exists?

How to upload files to Dropbox using API V2, so that if the names are the same, the old file is not overwritten. UploadsBuilder has a withAutorename method, I correctly understood that if true is passed to this method, then if there is a file with that name, then the new file will be given the name "name (1)"
But for some reason this does not work. Tried in different ways

client.files().uploadBuilder(pathFile).withAutorename(true).uploadAndFinish(in)
client.files().uploadBuilder(pathFile).withMode(WriteMode.ADD).withAutorename(true).uploadAndFinish(in)
client.files().uploadBuilder(pathFile).uploadAndFinish(in)

The result is the same, the file is simply overwritten

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question