Accessing public shares over WebDAV fails with 405 Not Allowed

What I want to do:
I want to access a public share via a WebDAV client (Cyberduck).

Steps I am taking
Cyberduck (8.4.5) → Open Connection → WebDAV (HTTPS)

Output:

WebDAV (HTTPS) connection opened
Login successful
Listing directory /

Error:

Listing directory / failed.
Unexpected response (405 Not Allowed). Please contact your web hosting service provider for assistance.

Interesting:

  • When I open the Url in the Browser I can enter the share token as username and the file get’s downloaded, so I guess the Url, username and password is correct. But then I do not see what I am doing wrong.
  • When I am trying it on another WebDAV client (FolderSync for Android) I am getting the same response.
  • I can connect via WebDAV to my whole account when I am using https://my.domain.de/remote.php/dav/files/[USERNAME]/

Source see docs:
https://docs.nextcloud.com/server/latest/user_manual/en/files/access_webdav.html#accessing-public-shares-over-webdav

And just because of curiosity: Is there a way to ‘include’ the username (and if needed password) in the Url when you enter it in a browser? So that you are instantly prompted with a download without separately have to enter the username?

Thanks for your Time and Help :slight_smile:

Okay, I revisited this Problem.

What I found out:
It seems I tried it with a share token from a file and not a folder, so ‘Listing directory /’ failed.
Now when I try it with Cyberduck and a share token from a folder it works :slight_smile:

With FolderSync I can’t get it to work, it seems I do enter something wrong. Anyone did this before?

If I had to take a wild guess:

Settings → Administration → Sharing → Allow users on this server to send shares to other servers. This option also allows WebDAV access to public shares needs to be enabled in order to make this feature work, except if cURL is being used (see below).

It may be that Cyberduck is by default including the X-Requested-With: XMLHttpRequest header that cURL can to bypass this requirement.

Disclaimer: I use WebDAV heavily but rarely with public shares and only have FolderSync on a “to be evaluated” list.