php.net |  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: vjl at uci dot edu
New email:
PHP Version: OS:

 

 [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>
<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/


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-23 01:08 UTC] sniper@php.net
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
from http://www.php.net/downloads.php

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 Apr 25 11:01:30 2024 UTC