From:             namejko at topiksolutions dot com
Operating system: Windows NT 5.1 build 2000 (XP)
PHP version:      4.3.1
PHP Bug Type:     HTTP related
Bug description:  File upload support does not populate $_FILES, $_POST

Description:
------------
This version of PHP appears to not handle file uploads properly.  Code
verbatim from the documentation to use the multipart/form-data enctype in
POST forms don't actually send the information properly into $_POST or
$_FILES.  Instead, the request comes across in $_GET, where it is
unusable.  In previous versions of PHP (in this case, tested on 4.0.6) the
code works perfectly.  Below are the HTML form code and the PHP code,
together in one file.  On 4.3.1, $_POST and $_FILES are empty arrays,
whereas they are filled on 4.0.6.

Reproduce code:
---------------
<?php
    print_r($HTTP_POST_VARS);
    print_r($HTTP_GET_VARS);
    print_r($HTTP_POST_FILES);
?>
<form method="post" enctype="multipart/form-data"
action="<?=$PHP_SELF?>">
<input type="hidden" name="MAX_FILE_SIZE" value="30000">
File:  <input name="userfile" type="file">
<input type="submit" name="submit" value="submit">
</form>


Expected result:
----------------
This is what is returned under PHP 4.0.6:

Array
(
    [MAX_FILE_SIZE] => 30000
    [submit] => submit
)
Array
(
)
Array
(
    [userfile] => Array
        (
            [name] => Icon7EFDA3AC3.txt
            [type] => application/octet-stream
            [tmp_name] => /tmp/phpEPVaEg
            [size] => 27648
        )

)
...

Actual result:
--------------
This is what is returned by PHP 4.3.1:

Array
(
)
Array
(
    [Content-Disposition:_form-data;_name] => \"MAX_FILE_SIZE\"

30000
-----------------------------7d32f4b280238
Content-Disposition: form-data; name=\"userfile\";
filename=\"C:\\Documents and Settings\\Zawitz\\Application
Data\\Microsoft\\Installer\\{7EFDA3AC-8A61-43C0-B023-33866829C816}\\Icon7EFDA3AC3.txt\"
Content-Type: application/octet-stream

MZ
)
Array
(
)
---

-- 
Edit bug report at http://bugs.php.net/?id=24694&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=24694&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=24694&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=24694&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=24694&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=24694&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=24694&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=24694&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=24694&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=24694&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=24694&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=24694&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24694&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=24694&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=24694&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=24694&r=gnused

Reply via email to