From:             david at olyeo dot co dot uk
Operating system: Ubuntu 8.04
PHP version:      5.2CVS-2009-03-03 (snap)
PHP Bug Type:     Streams related
Bug description:  Problem with multi-dimensional $_FILES

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
                                        ),

                                ),

                        ),

                ),

        ),

);

-- 
Edit bug report at http://bugs.php.net/?id=47553&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=47553&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=47553&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=47553&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=47553&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=47553&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=47553&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=47553&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=47553&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=47553&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=47553&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=47553&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=47553&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=47553&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=47553&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=47553&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=47553&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=47553&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=47553&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=47553&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=47553&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=47553&r=mysqlcfg

Reply via email to