dropbox / dbxcli

A command line client for Dropbox built using the Go SDK
Other
1.05k stars 100 forks source link

List deleted files and possibly recover them #71

Open gustavo-momente opened 7 years ago

gustavo-momente commented 7 years ago

Currently I can only restore a file if I know its revision.

But imagine that somehow a bunch of files got deleted and I didn't got their revision or their name, so I'd like to recovery all those deleted files.

I think I could figure out a solution if somehow I could list deleted files, so would that be possible?

diwakergupta commented 7 years ago

@gustavo-momente this should be easy to implement!

The list_folders API already has a include_deleted flag (defaults to False). So you'd need to introduce an option to set that. See https://godoc.org/github.com/dropbox/dropbox-sdk-go-unofficial/dropbox/files#ListFolderArg

Once you have a path for a deleted file, restoring should be simple too. See https://www.dropbox.com/developers/documentation/http/documentation#files-restore and https://godoc.org/github.com/dropbox/dropbox-sdk-go-unofficial/dropbox/files#Client

Feel free to submit a PR!