2
votes

I want to upload a file on jobs request page in my site but after upload file on my page, I'm getting the following error:

Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException The file "" does not exist

My code is:

$path = $request->file('image')->store('public');
echo $path;
2
check file exists in request dd($request->hasFile('image')); - Mayuri Pansuriya
please show your form, and say your code is on local or server? - parastoo amini
@Anas Alweish i try this solution but it did'nt solve. - Mehdi Salimi
@amini.swallow my form is <form action="{{ URL::to('/testjob')}}" enctype="multipart/form-data" method="post"> <input type="file" name="image"> <br> <input type="hidden" value=" {{ csrf_token() }}" name="_token"> <input type="submit" value="OK"> </form> - Mehdi Salimi

2 Answers

2
votes

In the php.ini file, change the following codes:

upload_max_filesize = 20M
post_max_size = 20M

I hope it works

0
votes

Very obvious but still bit me sometimes:

Make sure your file input field is set as required.

<input name="image" type="file" required>

Forgetting to set it required will make it possible to upload empty files which causes this exact error message.