# WebDAV

WebDAV is file access over HTTP. With it, a user's folders appear as a drive in the Windows Explorer, the macOS Finder or a Linux file manager, and programs open and save files there directly. CrushMFT answers WebDAV on its [web listeners](Ports-HTTP.md); there is no separate port for it.

## Turning it on

Two things must allow it.

| Where | Setting | New server |
|---|---|---|
| the listener, tab **Advanced** | **Allow Users To Use WebDAV** | off |
| the user, [Protocols a user may use](Users-Restrictions-Protocols.md) | WebDAV among the allowed protocols | as the user is set |

Use an HTTPS listener. WebDAV sends the password with every request; over plain HTTP anybody on the way reads it, and Windows refuses a plain connection with a password anyway.

## The address

The address of the web listener itself, with nothing after it:

```
https://files.example.com/
```

The user is asked for their name and password and sees their own folders. A folder can be named in the address to open the drive there: `https://files.example.com/Projects/`.

How to connect from each system is on [Mounting with WebDAV](Connect-WebDAV.md).

## Tried on the test server

With the switch **off**, a WebDAV request is not answered as WebDAV: asked for a listing (`PROPFIND`), the test server said `404 The selected resource was not found.`, and to the question what it can do (`OPTIONS`) it answered with a redirect to the login page.

With the switch **on**:

| Request | Answer |
|---|---|
| `OPTIONS` | `200`, with `DAV: 1,2` and the list of methods: GET, HEAD, OPTIONS, PUT, POST, COPY, PROPFIND, DELETE, LOCK, MKCOL, MOVE, PROPPATCH, UNLOCK, ACL |
| `PROPFIND`, a listing | `207`, the folder with its dates, and for a user with a quota the quota and what is used of it |
| `PUT`, an upload | `201` |
| `MKCOL`, a new folder | `201` |
| `MOVE`, a rename | `201` |
| `DELETE` | `204` |

A plain upload with `PUT` and a download with `GET` are ordinary web requests and work with the switch off too.

## What applies

A WebDAV session is a session like any other. The user's [permissions](VFS-Permissions.md), [quota](Quota.md), [file filters](Users-Misc-File-Filters.md), [events](Users-Events.md) and limits all hold, and every request is in the log.

The server answers locking (`LOCK`, `UNLOCK`), which office programs ask for before they save.

## Things to know

- File managers are chatty. Opening one folder can be dozens of requests; macOS also writes small helper files (`.DS_Store`, `._name`) into every folder it shows. A name filter keeps those out: [File name filters](Prefs-Restrictions-Filename-Filters.md).
- A drive over WebDAV is slower than one over SMB in the same network. It is the right tool across the internet, where SMB should not be open.
- A user with a second factor cannot type a code into a drive mapping. Give such users an access of their own for WebDAV, or see the server's settings for where a second factor is asked.
- Behind a reverse proxy or load balancer, the proxy must pass the WebDAV methods through and not cut long uploads: see [Behind a proxy](Ports-Behind-a-Proxy.md).

CrushMFT can also be the client: a user's folder can point at another WebDAV server. See [WebDAV servers](VFS-WebDAV.md).
