We Want to Hear From You! What Do You Want to See on the Community? Tell us here!

Forum Discussion

Linguation's avatar
Linguation
New member | Level 2
8 years ago
Solved

Autorename for existing files on upload does not rename .NET

Here is the piece of code which is supposed to rename an existing file and upload it to Dropbox. It simply does nothing. What am I missing here?

 

using (var memFile = new FileStream(srcFile, FileMode.Open, FileAccess.Read))
{
var uploadFile= await dbx.Files.UploadAsync("/myfolder/" + fileName, WriteMode.Add.Instance, body: memFile, autorename: true);
}


Any help would be appreciated.

  • Are you uploading the same data again? If the data is exactly the same as what already exists at the destination path, no conflict will occur and it won't create a renamed copy.

2 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    8 years ago
    Are you uploading the same data again? If the data is exactly the same as what already exists at the destination path, no conflict will occur and it won't create a renamed copy.
  • Linguation's avatar
    Linguation
    New member | Level 2
    8 years ago
    I thought only the file name is important. I just changed the file content and it renamed the file as expected. Thanks for that.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,036 PostsLatest Activity: 9 months ago
411 Following

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!