cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

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: 

Rename files without losing any versions

Rename files without losing any versions

Andry1
Explorer | Level 3

Hello. I'm trying to rename the files as follows (.Net):
using (var dbx = new DropboxClient(user.DropboxAccessToken))
{
await dbx.Files.MoveAsync(string.Format("/{0}/{1}", pathWithoutName, oldName), string.Format("/{0}/{1}", pathWithoutName, newName), true, true);
}
As a result, I lose the version of the file.
Can I rename the files without losing any versions?
Thank you!

4 Replies 4

Greg-DB
Dropbox Staff
Unfortunately, there isn't currently a good solution here. After you move/rename a file, listing the revisions at the new path won't show the old revisions.

As a workaround though, you can call to list the revisions at the previous path, and they will still be there.

Andry1
Explorer | Level 3

Thanks for the answer.
If the file is renamed, say, three times. I want to see all revisions. To this end, I have to send requests to the three paths to unite them and display them. Do I understand correctly?

Greg-DB
Dropbox Staff
That's correct.

Greg-DB
Dropbox Staff
The API now offers the ability to list file revisions across moves/renames, by using the file ID. In the .NET SDK, that's available via the ListRevisions method. You can find more information in the documentation:

https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Files_Routes_FilesUserRoutes_ListRev...
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Andry1 Explorer | Level 3
What do Dropbox user levels mean?