clean failed upload chunks

Signed-off-by: Robin Appelman <robin@icewind.nl>
pull/38930/head
Robin Appelman 2 years ago
parent 32bbe3db81
commit 58a4a222d0
No known key found for this signature in database
GPG Key ID: 42B69D8A64526EFB
  1. 10
      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) {

Loading…
Cancel
Save