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
jdm2
6 years agoExplorer | Level 3
Determine if file has finished synchronising
I have a simple problem:
I store some data in DropBox which is shared between multiple people
Several times people have started editing the data bnefore it has finished synchronising
What I wa...
- 6 years ago
Dropbox doesn't offer an API for checking the status of the Dropbox desktop client like this, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.
Dropbox does offer an API, but it is for communicating directly with the Dropbox servers, regardless of the state of the local Dropbox desktop client (if any).
For this use case though, you could potentially implement some of this using code running on the local machine and talking to the Dropbox API. That is, for any particular file:
- read the locally available file data and compute its "content hash" as documented here
- call the Dropbox API /2/files/get_metadata endpoint for that file (or /2/files/list_folder[/continue] to list the contents of a folder) and get the relevant `content_hash` value
- compare the the local and remote content hash values: if they match, you know you have the same data locally and remote; if they don't match, the data differs.
There are still race conditions possible with such a process though. E.g., the desktop client could sync down the new version of a file right after you check the content hash of the old one and before you compare it with the remote one, etc.
By the way, those are links to the documentation for the HTTPS endpoints themselves, but we recommend using one of the official SDKs if possible. Those have corresponding native methods for the HTTPS endpoints.
jdm2
Explorer | Level 3
Unfortunately none of your solutions work better than doing nothing.
My users don't actually know which files they should worry about. They are real users who are experts in what they use the application for but donb't understand computers at all.
Moving the files out would make things worse - every change is small and atomic and I would be copying the whole file back every 10 seconds or less. DropBox does a marvelous job of propagating such changes to other users so crashes only affect the session in question.
The lack of such functionality seems like a real hole in DropBox. It does everything else I need it to autromatically,
I just want to be able to observe it. It must be possible since the file explorer in Windows can display the correct badge on each file according to whether it is synchronised or not.
Daphne
6 years agoDropbox Staff
Thanks or getting back to me here jdm2!
I completely understand that the steps I mentioned aren't ideal for you, the way each person uses Dropbox can vary a great deal.
The desktop app will sync any changes that are made and available on the web as soon as they're made. This should mean that when the file shows :white_check_mark:, the file is up to date and reflecting the version from the web.
Since the sync icons aren't ideal for you, can you let me know a little more detail how you would want to observe the versions locally and online?
If we don't have a way to do this through the app itself other than the sync status, there may be some users here who could make some suggestions based on how you'd like to do this (via command line perhaps or API).
Keep me posted!
- jdm26 years agoExplorer | Level 3
As I said in my original request
I want a subroutine which I can call in my application which takes a filename as argument and returns a status to indicate ideally the following statuses:
- The file is in DropBox and is synchronised to the cloud
- The file is in DropBox but isn't yet synchronised to the cloud
- The DropBox Service isn't running
- The file isn't in DropBox
I've looked through the API and I cannot find anything which gives this, to me fairly fundamental, information. I'm very happy to write the code if it is in the API, I just need the information as to how to find the information I need.
I don't like command line or web scrapers or similar because they are maintenance nightmares. I also don't like unsupported mechanisms for the same reason.
- Greg-DB6 years agoDropbox Staff
Dropbox doesn't offer an API for checking the status of the Dropbox desktop client like this, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.
Dropbox does offer an API, but it is for communicating directly with the Dropbox servers, regardless of the state of the local Dropbox desktop client (if any).
For this use case though, you could potentially implement some of this using code running on the local machine and talking to the Dropbox API. That is, for any particular file:
- read the locally available file data and compute its "content hash" as documented here
- call the Dropbox API /2/files/get_metadata endpoint for that file (or /2/files/list_folder[/continue] to list the contents of a folder) and get the relevant `content_hash` value
- compare the the local and remote content hash values: if they match, you know you have the same data locally and remote; if they don't match, the data differs.
There are still race conditions possible with such a process though. E.g., the desktop client could sync down the new version of a file right after you check the content hash of the old one and before you compare it with the remote one, etc.
By the way, those are links to the documentation for the HTTPS endpoints themselves, but we recommend using one of the official SDKs if possible. Those have corresponding native methods for the HTTPS endpoints.
About Discuss Dropbox Developer & API
Make connections with other developers
797 PostsLatest Activity: 2 days 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!