I am having a hard time using $_FILES
I want to check if it's empty or not and if it's not empty then it shouldn't try and uploading the file. How do I check this?
I am having a hard time using $_FILES
I want to check if it's empty or not and if it's not empty then it shouldn't try and uploading the file. How do I check this?
this question is duplicate but your answer is is_uploade_file() function.
This should work
also there is
You can use the UPLOAD_ERR_NO_FILE value:
Updated: Since sending $_FILES['input_name'] may throw a Notice
The other answers didn't work for me. So I post my solution: