Dropbox API overwrite upload files instead of rename it -
i trying upload files dropbox using java api (version 2-beta-4), of these files have same name.
what know is: reason send file (for instance "file.txt") dropbox, file uploaded, if send file same name (file.txt) dropbox overwrite old file new 1 instead of renaming "file (1).txt", setting autorename true , writemode add?
code:
dbxrequestconfig config = new dbxrequestconfig("sample", "pt_br"); string acesstoken = "..."; client = new dbxclientv2(config, accesstoken); inputstream input = new bytearrayinputstream(file.getbytes()); filemetadata file = client.files.uploadbuilder(path).mode(writemode.add).autorename(true) .mute(true).run(input);
thanks.
writemode.add
what's causing behavior. "add" means "add new file name," never overwrites existing file. if want overwrite existing file, use writemode.overwrite
.
(also, isn't writemode.add()
, writemode.overwrite()
? thought methods.)
Comments
Post a Comment