Webdav - lock on file doesn't work

hello everybody,

just a question about lock on files with network share (i mean webdav access or davfs2 access).
It doesnā€™t work at all for me : i use different OS (Windows 10, Linux Ubuntu Desktop 16.04 and MAC OS) and different Office suite (Microsoft, Libre, Open).
is there any specific configuration for making work that function ?

thanks

Bumping this ā€“ I tried to push a git repo to my nextcloud, but that doesnā€™t work without DAV locking.

I get the impression thereā€™s quite a bit of history here ā€“ webdav locking apparently isnā€™t very effective, but some clients use it

We have the same situation, we use Win10 and mapped network shares with webdav.
When two user open a file and edit it, there is no information that the file is locked for the second user via webdav. Is there a dav solution for this case in nextcloud?
Thanx!
Maz

This is a known behavior and a lack of feature at current: https://github.com/nextcloud/server/issues/1308

For me and some clients this is a serious problem. Weā€™re not amused about the ā€˜conflict savingsā€™ that seem to be the result of working/opening and saving an excel file by multiple people.
It has cost me a lot of time to discover that file locking isnā€™t working as Iā€™d expect for collaboration and group functionality in Nextcloud. Excel with macros and Forms is not supported outside excel.

We were planning to roll-out more Nextcloud intstances on our servers for multiple clients, but this behavior is not acceptable. When working with WebDav (network share in windows 10 and office 2016), this should work and as far as I read could work.

I found WebDrive as ā€˜pluginā€™. Their website gave no hope since the download pages could not be accessed and http and https sites are mixed up.

So what can the Nextcloud Team offer us to support file locking?

Hendrik

This behavior is an absolutley show stopper and overkill to use Nextcloud in business environments that are using WebDAV share drives. Solutions like ā€œTemporary file lockā€ are NOT solutions because no one logs into the webinterface and set a lock there for every file that have to be modify. Very badā€¦

1 Like

This feature is needed to work in business environments!

Since I could not find an answer, I found it myself via try-and-error and looking into the code.

Locking a File:

Request: LOCK remote.php/dav/files/user/folder/file.jpg
Body:
<d:lockinfo xmlns:nc=ā€œhttp://nextcloud.org/nsā€ xmlns:d=ā€œDAV:ā€>
<nc:lock>1</nc:lock>
</d:lockinfo>

Unlock File
Request: UNLOCK remote.php/dav/files/user/folder/file.jpg
Request Header:
Lock-Token= opaquelocktoken:e08b246e-6c40-4867-b06f-e9170dbb36d1

The Lock token will be send back in the request when locking a file (see above) or simply use PROPFIND method and include
<nc:lock/>
<nc:lock-token/>