Hello.
Using a file input type how can I check whether any file was selected?
I've tried 'isset($_FILES['Resume'])' and '$_FILES['Resume']['size']>0' but no joy. Thanks, Andy.
Check file upload selected
Moderator: General Moderators
Re: Check file upload selected
I've discovered that
seems to work, but I'm not sure why the other versions don't. Anyone know why? Thanks, Andy.
Code: Select all
if (empty($_FILES['Resume']['name'])) {
echo "You haven't selected a file.<br />";
exit();
}Re: Check file upload selected
The correct method is to check $_FILES[...][error]: if it ==4 then no file was uploaded.