From:             [EMAIL PROTECTED]
Operating system: Linux:  2.4.3 [Mandrake 8.0]
PHP version:      4.1.2
PHP Bug Type:     HTTP related
Bug description:  HTTP_POST_FILES not functioning w/ certain browsers

When running this code:

##-- upload_test1.html --##

<html><head><title>upload test</title></head>
<body>
<FORM ENCTYPE="multipart/form-data" METHOD="POST"
ACTION="upload_test2.php">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
&nbsp;<INPUT TYPE="FILE" NAME="vita" SIZE="30" MAXLENGTH="58">
 <INPUT TYPE="submit" NAME="update" VALUE="Commit Changes">
 <INPUT TYPE="RESET" NAME="Reset" VALUE="Reset Changes">
</form>
</body></html>


##-- upload_test2.php --##

<?php
if  ($HTTP_POST_FILES['vita']['tmp_name'] != 'none')
{
echo "a file was uploaded";
}
else
{
echo "nothing was uploaded";
}
?>

Different results depending on the browser one is using. If one uses
Galeon 1.2.0 under Linux or Mozilla 0.99 under linux, and one presses the
"commit" button WITHOUT uploading a file, the resulting page will display
"a file was uploaded". This is due to the fact that tmp_name is equal to
"" instead of "none" which it is supposed to be equal to. 

If one does upload a file, using galeon, tmp_file does get defined as it
should. 

/vjl/


-- 
Edit bug report at http://bugs.php.net/?id=16740&edit=1
-- 
Fixed in CVS:        http://bugs.php.net/fix.php?id=16740&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=16740&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=16740&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=16740&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=16740&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=16740&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=16740&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=16740&r=submittedtwice

Reply via email to