Level 70
In a polite way, just use Laravel Intervention packages that will help you handle and manipulate image easily.
Hi,
I upload a file on storage, this doing well but the file uploaded is corrupted.
Impossible to open the file.
Any idea? Thank you.
The code:
$media = new Media();
$file = $request->file('media');
$media->filename = $file->getClientOriginalName();
$media->extension = $file->getClientOriginalExtension();
$media->mime_type = $file->getClientMimeType();
$media->size = $file->getSize();
$media->save();
Storage::put($media->filename . '.' . $media->extension, $file);
Please or to participate in this conversation.