|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-03-05 13:03 UTC] jani@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 16 14:00:01 2025 UTC |
Description: ------------ Hi, I am just working with multi-dimensional file uploads and they are not coming out as expected, i.e. they are not coming out the same as a single file upload. I don't see why this should be - why not just output all file upload in the same way? Reproduce code: --------------- I am using a form that has these fields: <input type="file" name="submission[screenshot]" /> <input type="file" name="other[dem][][img][]" /> I am deliberately using multiple-depths as I am building an automatic form handler that will be able to handle any form. Expected result: ---------------- 'submission' => array ( 'screenshot' => array 'name' => 'monster_wallpaper.jpg' 'type' => 'image/jpeg' 'tmp_name' => '/tmp/php48lX2Y' 'error' => 0 'size' => 223262 ), 'other' => array ( 'dem' => array ( '0' => array ( 'img' => array ( '0' => 'mood_wallpaper.png' 'type' => 'image/png' 'tmp_name' => '/tmp/phpLotX1Q' 'error' => 0 'size' => 27809 ), ), ), ) Actual result: -------------- array( 'submission' => array ( 'name' => array ( 'screenshot' => 'monster_wallpaper.jpg' ), 'type' => array ( 'screenshot' => 'image/jpeg' ), 'tmp_name' => array ( 'screenshot' => '/tmp/php48lX2Y' ), 'error' => array ( 'screenshot' => 0 ), 'size' => array ( 'screenshot' => 223262 ), ), 'other' => array ( 'name' => array ( 'dem' => array ( '0' => array ( 'img' => array ( '0' => 'mood_wallpaper.png' ), ), ), ), 'type' => array ( 'dem' => array ( '0' => array ( 'img' => array ( '0' => 'image/png' ), ), ), ), 'tmp_name' => array ( 'dem' => array ( '0' => array ( 'img' => array ( '0' => '/tmp/phpLotX1Q' ), ), ), ), 'error' => array ( 'dem' => array ( '0' => array ( 'img' => array ( '0' => 0 ), ), ), ), 'size' => array ( 'dem' => array ( '0' => array ( 'img' => array ( '0' => 27809 ), ), ), ), ), );