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)
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.
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.
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.
What do you recommend for identifying changes to the actual file contents?
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).
So there's no way around needing to download the entire file just to see if it's the same as the local copy?
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.
Any news on this? Can we hope to see md5sum among the API methods some time soon?
Apologies, no news on this. I'm not aware of plans for this.
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?
That is good news, is the content_hash available on the Java API?
Yes, in the official Dropbox API v2 Java SDK it's available as FileMetadata.contentHash.
Hi!Is there any reason why content_hash, which was introduced in version 3.0.0, has been removed in version 3.0.1?
ref. https://mvnrepository.com/artifact/com.dropbox.core/dropbox-core-sdk
I have now updated to version 3.0.2 and everything seems to work as expected. Thanks so much for your feedback.