Req->Bug #45043 [Opn->Nab]: multi-dimensional form upload not reflected in $_POST

From: Date: Sat, 05 May 2018 19:42:32 +0000
Subject: Req->Bug #45043 [Opn->Nab]: multi-dimensional form upload not reflected in $_POST
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-215089@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=45043&edit=1 ID: 45043 Updated by: requinix@php.net Reported by: ryan at groovesource dot com Summary: multi-dimensional form upload not reflected in $_POST -Status: Open +Status: Not a bug -Type: Feature/Change Request +Type: Bug -Package: Feature/Change Request +Package: *General Issues Operating System: Linux Debian Etch 4.0r1 PHP Version: 5.2.6 Block user comment: N Private report: N New Comment: Old bug report is old. I don't remember what PHP 5.2 was doing, but currently no file upload data goes in $_POST. It's only $_FILES. Previous Comments: ------------------------------------------------------------------------ [2008-05-20 01:24:12] ryan at groovesource dot com 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 this bug report at https://bugs.php.net/bug.php?id=45043&edit=1

« previous php.bugs (#215089) next »