2025 sparked some incredible conversations across our community 👩💻. Discover the highlights and see what’s ahead in 2026.
Forum Discussion
SuryaMopuru
3 years agoExplorer | Level 3
Renaming a file is creating a copy in dropbox .NET SDK
When i try to rename file i see in dropbox a copy being created rather than just a name change.
This is how i am trying to achieve this:
using (var dbx = new DropboxClient(RefreshToken,Appkey...
SuryaMopuru
3 years agoExplorer | Level 3
How can i distinguish between rename and duplicate. Currently this is how i am trying to do:
using (var dbx = new DropboxClient(RefreshToken, Appkey, Appsecret))
{
try
{
var metadata = (await dbx.Files.GetMetadataAsync("/" + backupItem.Path));
if (metadata != null)
{
var remote = "/" + remoteUrl;
var fromPath = "/" + backupItem.Path;
RelocationResult result = await dbx.Files.MoveV2Async(fromPath, remote);
if(result != null)
{
var updated = await dbx.Files.UploadAsync(
"/" + remoteUrl,
mode: WriteMode.Overwrite.Instance,
body: fileStream);
}
}
}
catch
{
var updated = await dbx.Files.UploadAsync(
"/" + remoteUrl,
mode: WriteMode.Overwrite.Instance,
body: fileStream);
}
When i try to rename it is working because moveasync will get invoked but when i try to duplicate the file it is updating the existing file rather than duplicating it. Do we have any way to handle my scenario.
For the first time when user creates any file our GetMetadatAsync will throw an error because in the mentioned path we dont have file so it goes into catch block and upload the new file.
This should happen in duplication also.
Greg-DB
Dropbox Community Moderator
3 years agoI see you also opened a new thread for this, so I'll follow up with you there.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
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!