You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: developer_manual/client_apis/WebDAV/basic.rst
+57-15Lines changed: 57 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,22 @@
1
1
.. _webdavindex:
2
2
3
-
==========
4
-
Basic APIs
5
-
==========
3
+
==============================
4
+
Basic File & Folder Operations
5
+
==============================
6
6
7
7
This document provides a quick overview of the WebDAV operations supported in Nextcloud, to keep things readable it won't go into many details
8
8
for each operation, further information for each operation can be found in the corresponding RFC where applicable.
9
9
10
10
WebDAV basics
11
11
-------------
12
12
13
-
The base url for all (authenticated) WebDAV operations for a Nextcloud instance is :code:`/remote.php/dav`.
13
+
The base url for all (authenticated) WebDAV operations for a Nextcloud instance is :code:`/remote.php/dav`. For file operations, this usually
14
+
means paths below :code:`/remote.php/dav/files/{user}/...`.
14
15
15
16
All requests need to provide authentication information, either as a basic auth header or by passing a set of valid session cookies.
16
17
17
-
If your Nextcloud installation uses an external auth provider (such as an OIDC server) you may have to create an app password.
18
+
If your Nextcloud installation uses an external auth provider (such as an OIDC server) or enforces policies like 2FA, you may need to create an
19
+
app password for WebDAV clients and scripts.
18
20
To do that, go to your personal security settings and create one. It will provide a username and password which you can use within the Basic Auth header.
19
21
20
22
Public shares
@@ -82,12 +84,45 @@ Here is a JavaScript code sample to get you started:
82
84
</d:propfind>`,
83
85
})
84
86
87
+
Quick method/header cheat sheet
88
+
-------------------------------
89
+
90
+
The table below summarizes common WebDAV methods used by Nextcloud and the most relevant headers.
By default, a :code:`PROPFIND` request will only return a small number of properties for each file: last modified date, file size, whether it's a folder, etag and mime type.
89
123
90
124
You can request additional properties by sending a request body with the :code:`PROPFIND` request that lists all requested properties.
125
+
If a property is not supported for a resource, the server will report it as not found in the multi-status response for that property.
91
126
92
127
.. code-block:: xml
93
128
@@ -135,17 +170,22 @@ And here is how it should look in your DAV request:
The overwrite behavior of the move can be controlled by setting the :code:`Overwrite`head to :code:`T` or :code:`F` to enable or disable overwriting respectively.
496
+
The overwrite behavior of the move can be controlled by setting the :code:`Overwrite`header to :code:`T` or :code:`F` to enable or disable overwriting respectively.
455
497
456
498
Copying files and folders (rfc4918_)
457
499
------------------------------------
@@ -463,12 +505,12 @@ A file or folder can be copied by sending a :code:`COPY` request to the file or
The overwrite behavior of the copy can be controlled by setting the :code:`Overwrite`head to :code:`T` or :code:`F` to enable or disable overwriting respectively.
508
+
The overwrite behavior of the copy can be controlled by setting the :code:`Overwrite`header to :code:`T` or :code:`F` to enable or disable overwriting respectively.
467
509
468
510
Settings favorites
469
511
------------------
470
512
471
-
A file or folder can be marked as favorite by sending a :code:`PROPPATCH` request to the file or folder and setting the :code:`oc-favorite` property
513
+
A file or folder can be marked as favorite by sending a :code:`PROPPATCH` request to the file or folder and setting the :code:`oc:favorite` property.
472
514
473
515
.. code-block:: xml
474
516
@@ -487,7 +529,7 @@ Setting the :code:`oc:favorite` property to ``1`` marks a file as favorite, sett
487
529
Listing favorites
488
530
-----------------
489
531
490
-
Favorites for a user can be retrieved by sending a :code:`REPORT` request and specifying :code:`oc:favorite` as a filter
532
+
Favorites for a user can be retrieved by sending a :code:`REPORT` request and specifying :code:`oc:favorite` as a filter.
0 commit comments