0
votes

I have implemented WebDAV server, and need to save the document after editing is completed, from temporary editing folder to Repository. When Word is closed after editing, it calls http UNLOCK method and then I save it SaveFileToRepository(...).

The problem is that UNLOCK is also called when Word is opened and switched from Protected mode to Editing mode and then a new LOCK is created. Two unlocks create two identical documents in Repository, what could be the solution?

Both UNLOCK requests are identical except Lock-Token key, I think it is not possible to tell which is last unlock.

One of my solutions is to add WebDAV url in

MS Word Options->Trust Center Settings->Trusted Locations-> check Allow Trusted Locations on my network and Add new location

which makes the document open in Editing mode. But is there any better solution?

1

1 Answers

1
votes

When you stash the document into your document store generate an SHA512 checksum value - compare that with the edition already in the document store. If checksum==checkum silently discard the save. This should be reasonably easy to implement and storing document checksums is really useful. Applications which cycle locks or issue multiple-locks are common.