Skip to content

Commit b935725

Browse files
authored
Merge pull request #38100 from tanganellilore/fix_delete_ChunkingV2Plugin
2 parents 46bb952 + d920e65 commit b935725

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

apps/dav/lib/Upload/ChunkingV2Plugin.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -255,17 +255,15 @@ public function beforeMove($sourcePath, $destination): bool {
255255

256256
public function beforeDelete(RequestInterface $request, ResponseInterface $response) {
257257
try {
258-
$this->prepareUpload($request->getPath());
259-
if (!$this->uploadFolder instanceof UploadFolder) {
260-
return true;
261-
}
262-
263-
[$storage, $storagePath] = $this->getUploadStorage($this->uploadPath);
264-
$storage->cancelChunkedWrite($storagePath, $this->uploadId);
265-
return true;
266-
} catch (NotFound $e) {
258+
$this->prepareUpload(dirname($request->getPath()));
259+
$this->checkPrerequisites();
260+
} catch (StorageInvalidException|BadRequest|NotFound $e) {
267261
return true;
268262
}
263+
264+
[$storage, $storagePath] = $this->getUploadStorage($this->uploadPath);
265+
$storage->cancelChunkedWrite($storagePath, $this->uploadId);
266+
return true;
269267
}
270268

271269
/**

0 commit comments

Comments
 (0)