mirror of
https://github.com/axeloz/filesharing.git
synced 2025-05-03 17:03:54 +02:00
Errors when storing uploaded files weren't raised.
This commit is contained in:
parent
2fdca6b0c7
commit
9d71927485
1 changed files with 6 additions and 1 deletions
|
@ -55,7 +55,7 @@ class UploadController extends Controller
|
|||
|
||||
// Generating the file name
|
||||
$original = $request->file->getClientOriginalName();
|
||||
$filename = substr(sha1($original.time()), 0, rand(20, 30));
|
||||
$filename = substr(sha1($original.time()), 0, mt_rand(20, 30));
|
||||
|
||||
// Moving file to final destination
|
||||
try {
|
||||
|
@ -72,6 +72,11 @@ class UploadController extends Controller
|
|||
$fullpath = $request->file('file')->storeAs(
|
||||
$bundle->slug, $filename, 'uploads'
|
||||
);
|
||||
|
||||
if (false === $fullpath) {
|
||||
throw new Exception('An error occurred while storing the file');
|
||||
}
|
||||
|
||||
// Generating file metadata
|
||||
$file = new File([
|
||||
'uuid' => $request->uuid,
|
||||
|
|
Loading…
Add table
Reference in a new issue