Your workflow is unique 👨‍💻 -  tell us how you use Dropbox here.

Forum Discussion

Conpak's avatar
Conpak
New member | Level 1
10 years ago

uploadasync is always overwriting

 

Here is my code:

var updated = await dbx.Files.UploadAsync("/Apps/design-orders" + "/" + file.FileName, WriteMode.Add.Instance, true, body: mem);

 

I have tried different combinations of the mode and autorename parameters but it always overwrites the existing file. I would like it to rename if the file name already exists.

2 Replies

Replies have been turned off for this discussion
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    This method and write mode seems to be working properly for me, so a few questions to help figure this out:

    - What version of the SDK are you using?

    - Are you getting any error or output?

    - Can you print out the result you're getting in "updated" (e.g., updated.PathLower)?

    - Are you uploading the same content? If you upload the same file content, it won't be considered a conflict, and so won't add a new file.

    - Does your app have the app folder permission? If so, you shouldn't be specifying "/Apps/{app folder name}" yourself. You should just specify "/", which will implicitly be your app folder root.

  • Conpak's avatar
    Conpak
    New member | Level 1
    10 years ago

    Gregory,

    My files had the same name but they also had the same content. I tested files with the same name but different content and it worked. Thank you!

About Dropbox API Support and Feedback

Node avatar for Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.

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, Facebook or Instagram.

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!