diff options
author | Robin Appelman <robin@icewind.nl> | 2023-07-20 19:29:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-20 19:29:42 +0200 |
commit | 6cf3e4b82c45ada330be9af835673d3bf311a7cb (patch) | |
tree | 9ab808607588c77fe612d3cacb40ddb84b2709e3 /apps/dav | |
parent | c912a3f0f63e8e7fe2d375094c2f04406911f13a (diff) | |
parent | 58a4a222d0e710fca513f968735fb6cdb95e7f92 (diff) | |
download | nextcloud-server-6cf3e4b82c45ada330be9af835673d3bf311a7cb.tar.gz nextcloud-server-6cf3e4b82c45ada330be9af835673d3bf311a7cb.zip |
Merge pull request #38930 from nextcloud/chunk-clean-failed
clean failed upload chunks
Diffstat (limited to 'apps/dav')
-rw-r--r-- | apps/dav/lib/Upload/UploadFolder.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/apps/dav/lib/Upload/UploadFolder.php b/apps/dav/lib/Upload/UploadFolder.php index 66c190d84d9..a1dade0e865 100644 --- a/apps/dav/lib/Upload/UploadFolder.php +++ b/apps/dav/lib/Upload/UploadFolder.php @@ -47,7 +47,15 @@ class UploadFolder implements ICollection { public function createFile($name, $data = null) { // TODO: verify name - should be a simple number - $this->node->createFile($name, $data); + try { + $this->node->createFile($name, $data); + } catch (\Exception $e) { + if ($this->node->childExists($name)) { + $child = $this->node->getChild($name); + $child->delete(); + } + throw $e; + } } public function createDirectory($name) { |