cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Emma uses to-do lists to get it all done 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: 

How do you track when only a file's contents have changed (API v2)

How do you track when only a file's contents have changed (API v2)

Brian S.53
Explorer | Level 3

How would I track when a file's contents have changed remotely?

 

I've seen the "rev" value, but this also increments when the file is moved/renamed, and I'd like to ignore any changes not related to the content changing.

2 Replies 2

Re: How do you track when only a file's contents have changed (API v2)

Greg-DB
Dropboxer

The rev is currently the best way to track changes like this. If the rev hasn't changed, you know that the file contents have changed. If the rev has changed, the file contents may have changed.

The rev does change when a file is moved or renamed though, as you mentioned. It sounds like you'd be better suited by a hash of the file contents. The Dropbox API doesn't currently offer files hashes like this, but I'll be sure to pass this along as a feature request. 

Re: How do you track when only a file's contents have changed (API v2)

Greg-DB
Dropboxer
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
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?