Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

AO's avatar
Level 1

file does not exist or is not readable

I have 2 fields to upload zip file and image .

When I upload both files I get this error :

The "php805B.tmp" file does not exist or is not readable.



        if ($request->hasFile('rfile')) {
            $file = $request->file('rfile');
            $file_name = time() . '.' . $file->getClientOriginalExtension();
            $destinationPath = public_path('/files/support/');
            $file->move($destinationPath, $file_name);
            $model->file = $file_name;

        }

            if ($request->hasFile('pic')) {
                $image = $request->file('pic');
                $name_image = time() . '.' . $image->getClientOriginalExtension();
                $destinationPath = public_path('/images/');
                $image->move($destinationPath, $name_image);
                $model->pic = $name_image;

            }




the rfile isn't large it's about 50kb so I do not upload large files.

the weird thing that this code was working. suddenly it stopped I Didn't change anything in the controller.

I have enctype="multipart/form-data" on my form.

any idea what's wrong here?

0 likes
11 replies
Sinnbeck's avatar

Did you try simply rebooting? Or restarting your server (vagrant?)

jlrdw's avatar
jlrdw
Best Answer
Level 75

Also use the browsers developer tools to see what's going on.

Also do a

dd($file);

first if then second if and see if that's working.

Perhaps also at the beginning of that controller method just echo something to see if you are hitting the controller:

echo "hello";

If it was working, perhaps a small change some where caused this. Have you changed anything in config or the .env file.

cmdobueno's avatar

The account on the server processing php does not have permission to write to the temp directory.

Basically your server is not properly configured.

Please give a little bit of background on the server, and I might be able to guide you to the correct answer.

Type of Server, Local/Remote? Are we in a laragon enviornment?

You know the basics.

AO's avatar
Level 1

I have a function in another controller that has the same code the post to upload .zip files and it's working fine.

My server is local / Laragon

AO's avatar
Level 1

I installed laravel-debugar and it shows that there is an error in save query.

@jlrdw thank you

jlrdw's avatar

I hope it all works now.

1 like
josphat's avatar

For me. I realized that I was trying to insert data into a non-existing column i.e I had not run php artisan migrate.

nisum's avatar

Could you solve your problem? Coz I have the same problem here

Please or to participate in this conversation.