aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2023-06-21 15:29:39 +0200
committerRobin Appelman <robin@icewind.nl>2023-06-21 15:32:27 +0200
commit58a4a222d0e710fca513f968735fb6cdb95e7f92 (patch)
treeed680705038dd25ebaef25ec13155eda143ba170 /apps/dav/lib
parent32bbe3db810bb10bde956b1030fb85d5aae16e4c (diff)
downloadnextcloud-server-58a4a222d0e710fca513f968735fb6cdb95e7f92.tar.gz
nextcloud-server-58a4a222d0e710fca513f968735fb6cdb95e7f92.zip
clean failed upload chunks
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/dav/lib')
-rw-r--r--apps/dav/lib/Upload/UploadFolder.php10
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) {