isset and !empty not passing through a check for uploaded files

Posted by kalpaitch on Stack Overflow See other posts from Stack Overflow or by kalpaitch
Published on 2010-03-30T22:02:20Z Indexed on 2010/03/30 22:13 UTC
Read the original article Hit count: 390

Filed under:
|
|

I have an upload form with a file to be uploaded. The issue I have is that even when no file is uploaded the if(isset($_FILES)) OR if(!empty($_FILES)) still passes as successful:

$_FILES = $HTTP_POST_FILES;
if($_POST['type'] == 'photo' && isset($_FILES)){
// returns true even if no file is uploaded. What am I missing!
}

© Stack Overflow or respective owner

Related posts about php

Related posts about fileupload