Skip to content
Advertisement

File upload not working in the php back-end. No file being found once I read it

I have made a form on php and I am adding an image input option there.

JavaScript

The following is my php code to upload the file.

JavaScript

It is not even entering the if condition in the above scenario. When I remove the if condition, I get “No file Found”. Sort of stumped here now because I have made it work in the past. I even tried the basic HTML query format like this mysqli_query($conn, $sql) or die(mysqli_error($conn)); and this does not work either.

Advertisement

Answer

Your form tag has to be enabled enctype="multipart/form-data".

Try this code.

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement