diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 7907cec66d..fcfd29dc6e 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -1643,7 +1643,14 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId') $device = Storage::getDevice('files'); - if ($device->delete($file->getAttribute('path', ''))) { + $deviceDeleted = false; + if($file->getAttribute('chunksTotal') !== $file->getAttribute('chunksUploaded')) { + $deviceDeleted = $device->abort($file->getAttribute('path')); + } else { + $deviceDeleted = $device->delete($file->getAttribute('path')); + } + + if ($deviceDeleted) { if ($bucket->getAttribute('permission') === 'bucket') { $deleted = Authorization::skip(function() use ($dbForExternal, $fileId, $bucketId) { return $dbForExternal->deleteDocument('bucket_' . $bucketId, $fileId); diff --git a/app/views/console/storage/bucket.phtml b/app/views/console/storage/bucket.phtml index 8f31b24d9d..ce87a5de96 100644 --- a/app/views/console/storage/bucket.phtml +++ b/app/views/console/storage/bucket.phtml @@ -158,7 +158,7 @@ $fileLimitHuman = $this->getParam('fileLimitHuman', 0); -
+
File Preview
@@ -188,7 +188,7 @@ $fileLimitHuman = $this->getParam('fileLimitHuman', 0);
-   +  
@@ -196,8 +196,11 @@ $fileLimitHuman = $this->getParam('fileLimitHuman', 0); - - +
+ + +
+ incomplete