In my form I have 3 input fields for file upload:
Method 1
if($_FILES['cover_image']['name'] == "") {
// No file was selected for upload, your (re)action goes here
}
Method 2
if($_FILES['cover_image']['size'] == 0) {
// No file was selected for upload, your (re)action goes here
}
check after the form is posted the following
$_FILES["cover_image"]["size"]==0
if ($_FILES['cover_image']['size'] == 0 && $_FILES['cover_image']['error'] == 0)
{
// Code comes here
}
This thing works for me........
if($_FILES['img_name']['name']!=""){
echo "File Present";
}else{
echo "Empty file";
}
if (!$_FILES['image']['size'][0] == 0){ //}