cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Learn all about apps and Dropbox integrations to make working from home easy 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: 

Upload API - skip upload, when file with the same content already uploaded

Upload API - skip upload, when file with the same content already uploaded

jijik
New member | Level 2

Dropbox windows app is smart and when currently uploading file already exists somewhere in dropbox (file with the same content hash I guess), it doesn't fully upload it again. It gets marked as uploaded almost immediately. Is it possible to achieve such optimization via the Dropbox Upload API? I use UploadSessionStartAsync APi, but it always fully upload any file even if the file already exists in neighbor directory.

Thank you

1 Reply 1

Re: Upload API - skip upload, when file with the same content already uploaded

Greg-DB
Dropboxer

The Dropbox API doesn't offer a way to do this automatically, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.

 

You could effectively reproduce this behavior though, at least within an account. To do, you'd need to do something like this:

  • Use /2/files/list_folder[/continue] to list the metadata for the contents of the account, which includes the 'content_hash' for each file. (You can cache this and update it over time as needed.)
  • Before starting an upload of a file, compute the content hash of the local data.
  • Check if that local content hash exists in the account already, by looking for it in the metadata retrieved in the first step.
  • If the content_hash is found in the existing metadata, use /2/files/copy_v2 to copy the existing file to the new path instead of uploading it again. If it is not found, proceed to upload it normally (e.g., using UploadSessionStartAsync, etc.).
Poll
How do you get refocussed while working from home? Do you find any of these options keep you from getting distracted?
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?