Skip to content
3 changes: 3 additions & 0 deletions apps/dav/lib/BulkUpload/BulkUploadPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* @copyright Copyright (c) 2021, Louis Chemineau <[email protected]>
*
* @author Louis Chemineau <[email protected]>
* @author Côme Chilliet <[email protected]>
*
* @license AGPL-3.0
*
Expand Down Expand Up @@ -95,6 +96,8 @@ public function httpPost(RequestInterface $request, ResponseInterface $response)
$writtenFiles[$headers['x-file-path']] = [
"error" => false,
"etag" => $node->getETag(),
"fileid" => $node->getId(),
"permissions" => $node->getPermissions(),
];
} catch (\Exception $e) {
$this->logger->error($e->getMessage(), ['path' => $headers['x-file-path']]);
Expand Down
16 changes: 13 additions & 3 deletions apps/dav/lib/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*
* @author Thomas Müller <[email protected]>
* @author Louis Chemineau <[email protected]>
* @author Côme Chilliet <[email protected]>
*
* @license AGPL-3.0
*
Expand All @@ -23,15 +24,24 @@
namespace OCA\DAV;

use OCP\Capabilities\ICapability;
use OCP\IConfig;

class Capabilities implements ICapability {
private IConfig $config;

public function __construct(IConfig $config) {
$this->config = $config;
}

public function getCapabilities() {
return [
$capabilities = [
'dav' => [
'chunking' => '1.0',
// disabled because of https://github.com/nextcloud/desktop/issues/4243
// 'bulkupload' => '1.0',
]
];
if ($this->config->getSystemValueBool('bulkupload.enabled', false)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm... I think the idea was to enable it by default.

cc @PVince81

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah but it needs to be confirmed working first :-P

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can set it to true at least for master, if we're optimistic 😄

we can then delay the backports until proven stable

$capabilities['dav']['bulkupload'] = '1.0';
}
return $capabilities;
}
}
7 changes: 7 additions & 0 deletions config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -2238,4 +2238,11 @@
* Defaults to ``false``
*/
'projects.enabled' => false,

/**
* Enable the bulk upload feature.
*
* Defaults to ``false``
*/
'bulkupload.enabled' => false,
];