Hi (salut) Andrei, the max upload size it is restricted from the php config .. so depends on how high you set the limit. It can be located in php.ini. It is recommended that you optimize it and maybe resize it to meet your needs. After all .. it is still going to aws .. :))
Oct 20, 2015
1
Level 4
Upload image to AWS S3 - resize problem
Hello , for few days i'm struggling to upload a file to aws. The problem it's not that i cannot upload it , it's that i cannot resize it in order to make it smaller.I've read that a good tool for this job is Image Intervention so i used it but it's not doing what it must. Here you have my store method from the controller :
$this->validate($request, [
'buletin' => 'mimes:jpeg,jpg,png,bmp',
'factura' => 'mimes:jpeg,jpg,png,bmp',
'card' => 'mimes:jpeg,jpg,png,bmp',
]);
$s3 = Storage::disk('s3');
$username = $request->input('username'); // this is the username which uploaded the file , as i dont use authentication system it's a hidden filed
//here i take the image , resize it and upload it to S3
$img = Image::make($request->file('buletin'))->encode('png')->resize(1024,768);
$fileFileName = $username . '_buletin';
$filePath = '/'.$username.'/' . $fileFileName;
$s3->put($filePath, (string)$img);
My big problem is that the user cand come and upload a 5 , 10 ,100 mb image , and i don't want to store such a huge file.
If you have any suggestions about how to handle this kind of image upload , maybe with an other package please advise.
Do you think it's a good option to upload the image directly from the request to aws ?
Thank you
Please or to participate in this conversation.