You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

Gonzo345's avatar
Gonzo345
Helpful | Level 5
8 years ago

Best practice to check if a folder exists in .NET?

Hi there!   I'm asking myself what's the best practice to check if a folder exists, because I made a fudge in the meanwhile and the performance is not optimal.   I'm giving the option to our ...
  • Greg-DB's avatar
    8 years ago
    We recommend using GetMetadataAsync to check if any particular file or folder already exists. It will return the metadata if so, or raise an exception you can catch if not.

    GetMetadataAsync would also be better than SearchAsync as searching is subject to an indexing delay.

    In either case though, there's going to be a race condition between checking (either via metadata or search) and then uploading. That being the case, check out the write mode options for uploading which offer different ways of handling conflicts.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,877 PostsLatest Activity: 9 hours ago
325 Following

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!