diff --git a/src/Http/Requests/StoreStorageRequestFile.php b/src/Http/Requests/StoreStorageRequestFile.php index d956b2c..3f10449 100644 --- a/src/Http/Requests/StoreStorageRequestFile.php +++ b/src/Http/Requests/StoreStorageRequestFile.php @@ -108,7 +108,7 @@ public function withValidator($validator) $shouldDeletePreviousChunks = false; if ($file->getSize() > $user->storage_quota_remaining) { - $validator->errors()->add('storage_exceeded', 'The file size exceeds the available storage quota.'); + $validator->errors()->add('file', 'The file size exceeds the available storage quota.'); $shouldDeletePreviousChunks = true; } @@ -170,6 +170,7 @@ public function withValidator($validator) $existsInOtherRequest = StorageRequestFile::join('storage_requests', 'storage_requests.id', '=', 'storage_request_files.storage_request_id') ->where('storage_requests.id', '!=', $this->storageRequest->id) ->where('storage_requests.user_id', $this->storageRequest->user_id) + // Don't use $path here, because it contains directory name ->where('storage_request_files.path','LIKE', '%'.$filename.'%') ->exists(); diff --git a/src/Jobs/DeleteStorageRequestFile.php b/src/Jobs/DeleteStorageRequestFile.php index 3358ef1..edc939f 100644 --- a/src/Jobs/DeleteStorageRequestFile.php +++ b/src/Jobs/DeleteStorageRequestFile.php @@ -77,7 +77,7 @@ public function handle() $file = StorageRequestFile::where('path','=',$this->path); // Do not delete files when delete-request is outdated - if($file->exists() && $this->retryCount != $file->first()->retry_count){ + if($file->exists() && $this->retryCount != $file->first()->retry_count) { return; } @@ -111,7 +111,7 @@ public function handle() } } - if($file->exists()){ + if($file->exists()) { $file->delete(); } } diff --git a/src/resources/views/create.blade.php b/src/resources/views/create.blade.php index a5ade27..1082859 100644 --- a/src/resources/views/create.blade.php +++ b/src/resources/views/create.blade.php @@ -131,7 +131,7 @@ class="btn btn-success"
Some file uploads failed.
+
Some file uploads failed