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/app_publishing_maintenance/app_upgrade_guide/upgrade_to_31.rst
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,6 +68,8 @@ Back-end changes
68
68
Added APIs
69
69
^^^^^^^^^^
70
70
71
+
- It is now possible to download folders as zip or tar archives using the WebDAV backend using :code:`GET` requests.
72
+
See the relevant :ref:`endpoint documentation<webdav-download-folders>`.
71
73
- ``OCP\SetupCheck\CheckServerResponseTrait`` was added to ease implementing custom :ref:`setup checks<setup-checks>` which need to check HTTP calls to the the server itself.
72
74
73
75
Changed APIs
@@ -79,12 +81,17 @@ Changed APIs
79
81
Deprecated APIs
80
82
^^^^^^^^^^^^^^^
81
83
82
-
- TBD
84
+
- The ``/s/{token}/download`` endpoint for downloading public shares is deprecated.
85
+
Instead use the Nextcloud provided :ref:`WebDAV endpoint<webdav-download-folders>`.
83
86
84
87
Removed APIs
85
88
^^^^^^^^^^^^
86
89
87
90
- Legacy, non functional, ``OC_App::getForms`` was removed.
91
+
- The private and legacy ``OC_Files`` class was removed.
92
+
Instead use ``OCP\AppFramework\Http\StreamResponse`` or ``OCP\AppFramework\Http\ZipResponse``.
93
+
- The private and legacy Ajax endpoint for downloading file archives (``/apps/files/ajax/download.php``) was removed.
94
+
Instead use the Nextcloud provided :ref:`WebDAV endpoint<webdav-download-folders>`.
88
95
- All ``OCP\ILogger`` logging methods, deprecated since Nextcloud 20, are removed.
89
96
- The interface now only holds the Nextcloud internal logging level constants.
90
97
For all logging ``Psr\Log\LoggerInterface`` should be used.
Copy file name to clipboardExpand all lines: developer_manual/client_apis/WebDAV/basic.rst
+49-2Lines changed: 49 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,11 +10,23 @@ for each operation, further information for each operation can be found in the c
10
10
WebDAV basics
11
11
-------------
12
12
13
-
The base url for all 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`.
14
14
15
15
All requests need to provide authentication information, either as a basic auth header or by passing a set of valid session cookies.
16
16
17
-
If your Nextcloud installation uses an external auth provider (such as an OIDC server) you may have to create an app password. 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.
17
+
If your Nextcloud installation uses an external auth provider (such as an OIDC server) you may have to create an app password.
18
+
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
+
20
+
Public shares
21
+
^^^^^^^^^^^^^
22
+
23
+
The :code:`/remote.php/dav` endpoint only allows authenticated access to WebDAV resources,
24
+
for files shared using public link shares a different endpoint is provided which does not require authentication.
25
+
26
+
The base URL for public link shares is :code:`/public.php/dav`, particularly for files: :code:`/public.php/dav/files/{share_token}`.
27
+
If a password is set for the share then a basic auth header must be sent with ``anonymous`` as the username and the share password as the password.
28
+
29
+
.. note:: This endpoint for public shares is available since Nextcloud 29.
18
30
19
31
Testing requests
20
32
----------------
@@ -343,12 +355,47 @@ You can request properties of a folder without also getting the folder contents
343
355
Downloading files
344
356
-----------------
345
357
358
+
.. note:: For shared files this only works if the download permission was not denied by the sharer.
359
+
346
360
A file can be downloaded by sending a :code:`GET` request to the WebDAV url of the file.
347
361
348
362
.. code::
349
363
350
364
GET remote.php/dav/files/user/path/to/file
351
365
366
+
.. _webdav-download-folders:
367
+
368
+
Downloading folders
369
+
-------------------
370
+
371
+
.. note:: The :code:`GET` method is not defined by the WebDAV standard, this is a Nextcloud specific WebDAV extension.
372
+
.. note:: For shared folders this only works if the download permission was not denied by the sharer.
373
+
374
+
A folder can be downloaded as an archive by sending a :code:`GET` request to the WebDAV URL of the folder.
375
+
The :code:`Accept` header must be set and contain the MIME type for ZIP archives (:code:`application/zip`) or tarballs (:code:`application/x-tar`).
376
+
377
+
.. code::
378
+
379
+
GET remote.php/dav/files/user/path/to/folder
380
+
Accept: application/zip
381
+
382
+
Optionally it is possible to only include some files from the folder in the archive by providing the files using the custom :code:`X-NC-Files` header:
383
+
384
+
.. code::
385
+
386
+
GET remote.php/dav/files/user/path/to/folder
387
+
Accept: application/zip
388
+
X-NC-Files: document.txt
389
+
X-NC-Files: image.png
390
+
391
+
As setting headers is not possible with HTML links it is also possible to provide this both options as query parameters.
392
+
In this case the :code:`Accept` header value must be passed as the :code:`accept` query parameter.
393
+
The optional files list can be provided as a JSON encoded array through the :code:`files` query parameter.
394
+
395
+
.. code::
396
+
397
+
GET remote.php/dav/files/user/path/to/folder?accept=zip&files=["image.png","document.txt"]
0 commit comments