minor fix

master
Константин 2024-02-05 19:33:55 +03:00
parent 4409f10551
commit d28e5f2191
1 changed files with 2 additions and 1 deletions

View File

@ -79,7 +79,7 @@ class UploadFileController extends Controller {
} elseif ($request->hasFile('file')) { } elseif ($request->hasFile('file')) {
$file = $request->file('file')->getRealPath(); $file = $request->file('file')->getRealPath();
$asset = $this->uploadFromDirectFile([ $asset = $this->uploadFromDirectFile([
'mime' => $request->file('file')->getMimeType(), 'mime' => $request->file('file')->getClientMimeType(),
'name' => $request->get('name') ?? $request->file('file')->getClientOriginalName(), 'name' => $request->get('name') ?? $request->file('file')->getClientOriginalName(),
'filename' => $request->file('file')->getClientOriginalName(), 'filename' => $request->file('file')->getClientOriginalName(),
'extension' => $request->file('file')->getClientOriginalExtension(), 'extension' => $request->file('file')->getClientOriginalExtension(),
@ -108,6 +108,7 @@ class UploadFileController extends Controller {
} }
protected function uploadFromDirectFile($attributes = []) { protected function uploadFromDirectFile($attributes = []) {
Storage::put("validating/{$attributes['name']}", $attributes['content']);
$this->validateMime($attributes['mime']); $this->validateMime($attributes['mime']);
$this->validateBodySize($attributes['Content-Length'], $attributes['content']); $this->validateBodySize($attributes['Content-Length'], $attributes['content']);
$path = $this->storeInFileSystem($attributes); $path = $this->storeInFileSystem($attributes);