check if $_files is empty php

83

check if $_files is empty php -

if($_FILES['cover_image']['size'] == 0) {
// No file was selected for upload, your (re)action goes here
}

php check if post file is empty -

if ($_FILES['cover_image']['size'] == 0 && $_FILES['cover_image']['error'] == 0)
{
    // cover_image is empty (and not an error)
}

Comments

Submit
0 Comments