|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-07-17 14:38 UTC] derick@php.net
[2003-07-21 14:06 UTC] namejko at topiksolutions dot com
[2003-07-21 14:26 UTC] iliaa@php.net
[2003-07-21 15:20 UTC] namejko at topiksolutions dot com
[2003-07-21 16:51 UTC] iliaa@php.net
[2003-07-21 17:14 UTC] namejko at topiksolutions dot com
[2003-07-22 10:36 UTC] sniper@php.net
[2003-07-22 12:24 UTC] namejko at topiksolutions dot com
[2003-07-24 21:11 UTC] iliaa@php.net
[2003-07-24 22:30 UTC] philip@php.net
[2003-07-25 11:39 UTC] namejko at topiksolutions dot com
[2003-07-27 14:04 UTC] sniper@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 11:00:02 2025 UTC |
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 ( ) ---