Hi all,

is there a possibillity to check how the user-file field is set ?

I tried :

<?PHP

print"<form method=POST action=$_SERVER[PHP_SELF] enctype=multipart/form-data>";

?>

<?
if(isset($_FILES['userfile']))
{
$im_set = "SET";
echo $im_set;
}
else
{
$Im_notSet = "NOT SET";
echo $Im_notSet;
}

<input name="userfile" type="file" class="forms" size="30">
?>
</form>

...but it doesn't work it always returns that it is set :/

Can anyone help me

Thanks

olli

    it will always be set, you want empty() and i assume $FILES['userfile']['name'] but you code is a little confusing print_r($FILES) will show you what you have to work with

      Also read this manual page to see how to deal with the error code returned: [man]features.file-upload.errors[/man]. This is probably the best way to deal with file upload fields and what the result was.

        Thanx a lot !

        f(!empty($_FILES['userfile']['tmp_name']))
        {
        ...
        }

        ...does it 🙂

        Olli

          Write a Reply...