How to forbid Windows WebDAV client to delete the file & How to intterupt/break delete process

243 views
Skip to first unread message

sumone

unread,
Jul 29, 2015, 10:32:24 AM7/29/15
to SabreDAV Discussion
I'm using sabre/dav library for my project and I'm having some difficulties with preventing default Windows WebDAV client "deleting" a file that shouldn't be deleted.
The implementation in the server part is ok and Forbidden statuses are thrown and acknowledged apparently by other clients (Finder, CyberDuck) that abort the deletion process with a forbidden error. The same statuses are thrown back at Windows client, but it seems that it simply "deletes" the files, that are still available on server-side. By refreshing the folder those files are again visible. It seems that Win client simply ignores the forbidden responses and virtually deletes folder, so that it isn't visible anymore.

The bigger problem is that if for a reason you decide to delete a folder, where there are protected and unprotected files/folders, it deletes all of the unprotected ones, because it fails to acknowledge the first (or any) Forbidden response. Other WebDAV clients detect this and stop the deletion process therefore files/folders underneath with the folder designated for deletion are untouched.

Example of a forbidden response, when trying to delete a folder or file:

HTTP/1.1 403 Forbidden
Server: nginx/1.8.0
Date: Wed, 29 Jul 2015 13:55:11 GMT
Content-Type: application/xml; charset=utf-8
Connection: keep-alive
X-Frame-Options: SAMEORIGIN
X-Powered-By: PHP/5.4.41-1~dotdeb+7.1
X-Sabre-Version: 2.1.3
Vary: Accept-Encoding,User-Agent
Content-Length: 320

<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:sabredav-version>2.1.3</s:sabredav-version>
  <s:exception>Sabre\DAV\Exception\Forbidden</s:exception>
  <s:message>Permission denied to delete node</s:message>
  <d:status>HTTP/1.1 403 Forbidden</d:status>
</d:error>

Tested default Win client on Win8.1 x86.

Any idea how to force Win WebDav client to detect Forbidden responses and terminate deletion process?

Thanks. 

Duck WebDev

unread,
Apr 30, 2016, 5:13:16 AM4/30/16
to SabreDAV Discussion
Did you ever find a solution to this?

sumone

unread,
Apr 30, 2016, 2:00:03 PM4/30/16
to SabreDAV Discussion
Nope. At the end we decided to detect the Windows client and forbid its access. You can also choose to display a readme file explaining that client isn't supported with the links to the supported one.
Reply all
Reply to author
Forward
0 new messages