|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16740 HTTP_POST_FILES not functioning w/ certain browsers
Submitted: 2002-04-23 00:46 UTC Modified: 2002-04-23 01:08 UTC
From: vjl at uci dot edu Assigned:
Status: Not a bug Package: HTTP related
PHP Version: 4.1.2 OS: Linux: 2.4.3 [Mandrake 8.0]
Private report: No CVE-ID: None
 [2002-04-23 00:46 UTC] vjl at uci dot edu
When running this code:

##-- upload_test1.html --##

<html><head><title>upload test</title></head>
<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">

##-- upload_test2.php --##

if  ($HTTP_POST_FILES['vita']['tmp_name'] != 'none')
echo "a file was uploaded";
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. 



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-23 01:08 UTC]
The version of PHP that this bug was reported in is too old. Please
try to reproduce this bug in the latest version of PHP (available

If you are still able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jun 20 02:01:30 2024 UTC