There are client libraries that can resize before sending to the server
Slim Cropper is good but its not free
Hi,
i'm facing this exception and ask for the best way to manage it.
I have this apache configuration :
upload_max_filesize => 5M => 5M post_max_size => 8M => 8M
and this rule in UploadRequest : 'image|mimes:jpeg,bmp,png|size:5000'
I read a lot about this question and found this solution that consist to catch the exception :
if ($exception instanceof \Illuminate\Http\Exceptions\PostTooLargeException) {
return response()->view('errors.posttoolarge');
}
What i'm looking for is not to redirect the user to this page. Because, i already inform him (mention in uplaod Form) of Max size (less than 5 MO). What I want to do is use intervention image and resize image to be less than Apache pre-requises .
So, finally what 's the best practice : should i have to write some function in Exception/Handler to resize and save image uploaded. And redirect then ?
thank you
Please or to participate in this conversation.