From: ryan at groovesource dot com
Operating system: Linux Debian Etch 4.0r1
PHP version: 5.2.6
PHP Bug Type: Feature/Change Request
Bug description: multi-dimensional form upload not reflected in $_POST
Description:
------------
To wit: a multidimensional upload will appear in $_FILES, but not in
$_POST. This seems vaguely reminiscent of #19848, but is not a dupe.
Reproduce code:
---------------
<html>
<head>
</head>
<body>
<form action="test.php" method="post"
enctype="multipart/form-data">
<input type="file" name="label[new_pics][]" /><br />
<input type="file" name="label[new_pics][]" /><br />
<input type="file" name="label[new_pics][]" /><br />
<input type="submit" />
</form>
</body>
</html>
-------------
<?php
// test.php
print_r($_REQUEST);
print_r($_POST);
print_r($_FILES);
Expected result:
----------------
Array
(
[label] => Array
(
[new_pics] => Array
(
[0] => background.jpg
[1] => techno.png
[2] => picture.gif
)
)
)
Array
(
[label] => Array
(
[new_pics] => Array
(
[0] => background.jpg
[1] => techno.png
[2] => picture.gif
)
)
)
Array
(
[label] => Array
(
[name] => Array
(
[new_pics] => Array
(
[0] => background.jpg
[1] => techno.png
[2] => picture.gif
)
)
[type] => Array
(
[new_pics] => Array
(
[0] => image/jpeg
[1] => image/png
[2] => image/gif
)
)
[tmp_name] => Array
(
[new_pics] => Array
(
[0] => /tmp/php0RVfzf
[1] => /tmp/phpSRTpTl
[2] => /tmp/phpWt2oxs
)
)
[error] => Array
(
[new_pics] => Array
(
[0] => 0
[1] => 0
[2] => 0
)
)
[size] => Array
(
[new_pics] => Array
(
[0] => 131470
[1] => 20827
[2] => 59648
)
)
)
)
Actual result:
--------------
Array
(
)
Array
(
)
Array
(
[label] => Array
(
[name] => Array
(
[new_pics] => Array
(
[0] => background.jpg
[1] => techno.png
[2] => picture.gif
)
)
[type] => Array
(
[new_pics] => Array
(
[0] => image/jpeg
[1] => image/png
[2] => image/gif
)
)
[tmp_name] => Array
(
[new_pics] => Array
(
[0] => /tmp/php0RVfzf
[1] => /tmp/phpSRTpTl
[2] => /tmp/phpWt2oxs
)
)
[error] => Array
(
[new_pics] => Array
(
[0] => 0
[1] => 0
[2] => 0
)
)
[size] => Array
(
[new_pics] => Array
(
[0] => 131470
[1] => 20827
[2] => 59648
)
)
)
)
--
Edit bug report at http://bugs.php.net/?id=45043&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=45043&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=45043&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=45043&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45043&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=45043&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45043&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45043&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45043&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45043&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45043&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=45043&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=45043&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45043&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45043&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45043&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45043&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45043&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45043&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45043&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45043&r=mysqlcfg