cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Update: Find information on Dropbox support during COVID-19 here
Close

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: 
Highlighted

Upload two documents with the same name .NET

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
Highlighted

Re: Upload two documents with the same name .NET

Dropboxer
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.

Polls
Do you know how to organize your files and folders?
We have created a guide on folder best practice, so you can get organized now check it out here.

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?