|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-04-25 17:20 UTC] jani@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 06 03:00:01 2025 UTC |
Description: ------------ At POST request with multidimensional form vars, $_FILES are not "correctly" assign, the $_FILES is not "easy" to handle with actual multidimensional assign, it is not consistent. Reproduce code: --------------- <?PHP if($_SERVER['REQUEST_METHOD'] == 'POST'){ print_r($_FILES); } ?> <form name="form" action="" enctype="multipart/form-data" method="POST"> <input type="file" name="file[]" /><br /> <input type="file" name="foto[]" /><br /> <input type="file" name="foto[]" /><br /> <input type="file" name="foto[]" /><br /> <input type="file" name="foto[]" /><br /> <input type="submit" value="Submit" /> </form> Expected result: ---------------- Array ( [file] => Array ( [0] => Array ( [name] => foto internet workstation.JPG [type] => image/jpeg [tmp_name] => C:\wamp\tmp\php171.tmp [error] => 0 [size] => 99115 ) [1] => Array ( [name] => gfs 0.JPG [type] => image/jpeg [tmp_name] => C:\wamp\tmp\php172.tmp [error] => 0 [size] => 26263 ) [2] => Array ( [name] => hoja membretiada.jpg [type] => image/jpeg [tmp_name] => C:\wamp\tmp\php173.tmp [error] => 0 [size] => 245987 ) [3] => Array ( [name] => img005CEDULA ADMINISTRATIVA.jpg [type] => image/jpeg [tmp_name] => C:\wamp\tmp\php174.tmp [error] => 0 [size] => 283589 ) [4] => Array ( [name] => kathe 3 copy.jpg [type] => image/jpeg [tmp_name] => C:\wamp\tmp\php175.tmp [error] => 0 [size] => 122558 ) ) ) Actual result: -------------- Array ( [file] => Array ( [name] => Array ( [0] => foto internet workstation.JPG ) [type] => Array ( [0] => image/jpeg ) [tmp_name] => Array ( [0] => C:\wamp\tmp\php15C.tmp ) [error] => Array ( [0] => 0 ) [size] => Array ( [0] => 99115 ) ) [foto] => Array ( [name] => Array ( [0] => gfs 0.JPG [1] => hoja membretiada.jpg [2] => img005CEDULA ADMINISTRATIVA.jpg [3] => kathe 3 copy.jpg ) [type] => Array ( [0] => image/jpeg [1] => image/jpeg [2] => image/jpeg [3] => image/jpeg ) [tmp_name] => Array ( [0] => C:\wamp\tmp\php15D.tmp [1] => C:\wamp\tmp\php15E.tmp [2] => C:\wamp\tmp\php15F.tmp [3] => C:\wamp\tmp\php160.tmp ) [error] => Array ( [0] => 0 [1] => 0 [2] => 0 [3] => 0 ) [size] => Array ( [0] => 26263 [1] => 245987 [2] => 283589 [3] => 122558 ) ) )