When I use the following to check if files exist, the form still submits as successfull even when no files are added?

PHP Code:
if(!$_FILES['photoname']) { 
     
$error_msg 'You must upload your portfolio photos';


Field formated like so:

PHP Code:
while($counter <= $number_of_fields){
     echo 
'<input name="photoname[]" type="file" id="upload" />';
$counter++;

Thanks