You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
Joel T.9
9 years agoNew member | Level 2
FileMetadata checksum
Is there something better than file size to use as a checksum?
Maybe Sha1 or MD5? I didn't see one on the FileMetadata class. It appears "Rev" changes even when the contents haven't changed (ie. on file rename)
- Greg-DBDropbox Staff
The Dropbox API doesn't offer any sort of file hash or checksum unfortunately, but I'll be sure to pass this along as a feature request.
- Joel T.9New member | Level 2
That would be great, "file size" is the only item that appears to be correlated with the actual content, please correct me if I'm wrong, even date changes simply on file name change.
- Greg-DBDropbox Staff
Yes, even the date would change. The file size will always indicate the size of the file contents, though we don't recommend using that as a way to identify the actual contents of course.
- Brian S.53Explorer | Level 3
What do you recommend for identifying changes to the actual file contents?
- Joel T.9New member | Level 2
For the time being, I'm fetching the file and calculating the MD5 myself. I'm hoping Dropbox will allow access to the checksum they are already calculating, and I'll just replace with that... Hopefully they will give us access (and it's not a different algorithm).
- Brian S.53Explorer | Level 3
So there's no way around needing to download the entire file just to see if it's the same as the local copy?
- Greg-DBDropbox Staff
Hi Brian, I just replied on the new thread you started, but in short, yes, that's correct, the Dropbox API doesn't currently offer file hashes, so you'd need to download it to check the contents.
- Olaf B.2New member | Level 2
Any news on this? Can we hope to see md5sum among the API methods some time soon?
- Greg-DBDropbox Staff
Apologies, no news on this. I'm not aware of plans for this.
- Matt A.6New member | Level 1
I agree, having the ability within the web UI interface to see the file checksums (MD5 and SHA1, at least), would be greatly beneficial in order to help in determining whether files that have been uploaded/downloaded are complete and accurate. An additional tie in to this would be ability to add alerts if a checksum changed - maybe file version history would offer this?
- Greg-DBDropbox StaffThe Dropbox API now offers a hash of file data that you can use to verify a file's contents. You can find it in FileMetadata.content_hash. It isn't a single MD5 or SHA1, but rather a combination of SHA256 hashes of the pieces of the file. You can find more information here:
https://www.dropbox.com/developers/reference/content-hash- Team F.1Explorer | Level 4
That is good news, is the content_hash available on the Java API?
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,917 PostsLatest Activity: 2 minutes ago
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 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!