add documentation about the bulk upload protocol

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
Matthieu Gallien
2022-02-04 12:09:33 +01:00
parent 91c81abe88
commit 2eedb519dc
2 changed files with 44 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
===================
File bulk upload
===================
.. sectionauthor:: Matthieu Gallien <matthieu.gallien@nextcloud.com>
Introduction
------------
Uploading many small files is often slower than what could be achieved because we do not
use the whole network bandwidth. Nextcloud has a bulk upload API where you can upload
many small files together in order to optimize the use of network bandwidth.
Usage
-----
The API is only available for registered users of your instance. And uses the path:
``<server>/remote.php/dav/bulk``.
Starting a bulk upload
^^^^^^^^^^^^^^^^^^^^^^^^^
A bulk upload is simply using a request structured as HTTP multipart with related mime type.
Each file is then sent as one HTTP part.
Each file inside an HTTP Part will need the following headers:
* Content-Length: <file size>
* Content-Type: <mimetype>
* X-File-MD5: <md5 checksum>
* X-File-Mtime: <modification time of file>
* X-File-Path: <destination file path>
The reply is a json document with the following structure:
.. code-block:: JSON
{
"/small file.txt": {
"error": false,
"etag": "adb9aa24cbfa8e372c88431d1d99629a"
}
}

View File

@@ -12,4 +12,5 @@ Webdav
trashbin
versions
chunking
bulkupload
comments