I'm trying to implement a file synchronization between a local folder and a distant Google Drive. The classic problem is when some modifications are made on both sides simultaneously. So when I update a file locally, I have to make sure file has not been modified on Google Drive before performing the upload so that I can manage conflicts. Regarding Google Drive SDK, I have multiple options to detect that:
Google seems to privilege the second option. But with both of them, there is no way to be sure that file has not been modified at the time of upload. Basically, I need an atomic upload operation which:
Is there any way to do this?
Thanks
If you add and If-Match
to your HTTP headers on your PUT requests, it should be rejecting outdated versions and respond with error.
If-Match: "S0wCTlpIIip7ImA0X0QI"