Search Dropbox or Google Drive by File Hash or File Metadata?

旧城冷巷雨未停 提交于 2019-12-25 06:34:00

问题


I'm looking for a way to synchronize an archive of photos with an archive stored on Google Drive or Dropbox. One of the things that I need to do is to be able to rapidly determine if a given photo has already been uploaded to the remote file system.

The ideal way to do this would be to search by file hash, but looking at the APIs, I can't see an easy way to do that. Dropbox does allow you to walk the user's Dropbox and download metadata (which appears to include an MD5 hash).

Is there a better way?


回答1:


The 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

The API doesn't offer a way to search by this hash, but you can download the file metadata with it, and refer to it locally.



来源:https://stackoverflow.com/questions/36252508/search-dropbox-or-google-drive-by-file-hash-or-file-metadata

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!