cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Emma uses to-do lists to get it all done here!

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Upload two documents with the same name .NET

Upload two documents with the same name .NET

m4man
Explorer | Level 3

How can I upload the same document more than once without overriding the existing one? I need to have both.

 

WriteMode mode = new WriteMode();
await dbx.Files.UploadAsync(remotePath, body: fileStream, mode: mode.AsAdd, autorename: true);

 

I tried that, but it doesn't upload the second one, it's just don't do anything.

I need to have both documents and to auto-rename the second one with (2) or _2 for example.

 

Thank you.

1 Reply 1

Re: Upload two documents with the same name .NET

Greg-DB
Dropboxer

Are you attempting to upload the same exact file content by any chance? From the WriteMode documentation:

 

"If the target path contains a file with identical contents, nothing gets written; no conflict."

 

Try uploading different data and you should get the rename behavior.

 

If you do need to upload an exact copy, you can explicitly specify a different remotePath, or you can use CopyAsync.

Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?