We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Forum Discussion
jijik
4 years agoNew member | Level 2
Upload API - skip upload, when file with the same content already uploaded
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
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.).
- Greg-DBDropbox Staff
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.).
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,877 PostsLatest Activity: 5 hours agoIf 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!