Jo Micheal
Published in : 2021-12-19
Symfony\Component\Mime\Exception\InvalidArgumentException: The "" file does not exist or is not readable. this error came to my website when I try to upload files using Laravel Storage class with jQuery ajax, here is the code which I am using
public function uploadImageAjax(Request $req){ if($req->image){ $image_name = basename( Storage::disk('public')->put('products/', $req->image)); $link = url('/').'/storage/products/'.$image_name; return $link; } }
Can anyone help me please?
Join our community and get the chance to solve your code issues & share your opinion with us
Sign up Now
Joseph Morgan Date : 2021-12-19
Best answers
11
Best answers
11
That's because the maximum value of the uploading in your server is less than the size of the image, so you can increase the size of uploading in your php.ini, you will need to locate the php.ini file in your server using phpinfo(); you can use a simple routing with the function like this,
you can search about "Loaded Configuration File" in the phpinfo() page
and copy the path like the screenshot below
then open the php.ini in the editing mode using the code below, when you are in the folder of your php version,
then
when you get into the file search about upload_max_filesize you can search in the terminal using Ctrl W then you can update it to 6M or whatever you want, and also increase the post_max_size, max_file_uploads and to avoid the run out time you can increase max_execution_time, example of editing the upload_max_filesize attached below
then don't forget to restart the php service using
That's all let me know if you have another questions
Jo Micheal Date : 2021-12-19
Thank you Joseph for this explanation, i followed your leads and everything works fine
Mohamed Atef Date : 2021-12-19
Best answers
51
Best answers
51
You can fix it as Joseph said by increasing the limit of upload files in the server, or you can limit it in the users using Validator class like the code below