title: CakePHP 2.X upload multiple files at same time
body: <p>How are you supposed to use arrays of "CakePhpRequest" when uploading multiple files?</p>
  
  <p>I have this result</p>
  
  <pre><code>CakeRequest Object
  (
  [params] =&gt; Array
      (
          [plugin] =&gt; 
          [controller] =&gt; users
          [action] =&gt; upload
          [named] =&gt; Array
              (
              )
  
          [pass] =&gt; Array
              (
              )
  
          [form] =&gt; Array
              (
                  [files] =&gt; Array
                      (
                          [name] =&gt; Array
                              (
                                  [0] =&gt; php.exe
                                  [1] =&gt; php.gif
                                  [2] =&gt; php.ini
                                  [3] =&gt; php.ini-development
                                  [4] =&gt; php.ini-production
                              )
  
                          [type] =&gt; Array
                              (
                                  [0] =&gt; application/x-msdownload
                                  [1] =&gt; image/gif
                                  [2] =&gt; application/octet-stream
                                  [3] =&gt; application/octet-stream
                                  [4] =&gt; application/octet-stream
                              )
  
                          [tmp_name] =&gt; Array
                              (
                                  [0] =&gt; C:\xampp\tmp\php455E.tmp
                                  [1] =&gt; C:\xampp\tmp\php456E.tmp
                                  [2] =&gt; C:\xampp\tmp\php456F.tmp
                                  [3] =&gt; C:\xampp\tmp\php4570.tmp
                                  [4] =&gt; C:\xampp\tmp\php4571.tmp
                              )
  
                          [error] =&gt; Array
                              (
                                  [0] =&gt; 0
                                  [1] =&gt; 0
                                  [2] =&gt; 0
                                  [3] =&gt; 0
                                  [4] =&gt; 0
                              )
  
                          [size] =&gt; Array
                              (
                                  [0] =&gt; 73728
                                  [1] =&gt; 2523
                                  [2] =&gt; 78907
                                  [3] =&gt; 72908
                                  [4] =&gt; 72941
                              )
  
                      )
  
              )
  
      )
  
  [...] other data
  </code></pre>
  
  <p>do I have to calculate how many files have been uploaded and then iterate all using a number?</p>
  
  <p>Would not it be easier if the output was like this?</p>
  
  <pre><code>CakeRequest Object
  (
  [params] =&gt; Array
      (
          [plugin] =&gt; 
          [controller] =&gt; users
          [action] =&gt; upload
          [named] =&gt; Array
              (
              )
  
          [pass] =&gt; Array
              (
              )
  
          [form] =&gt; Array
              (
                  [files] =&gt; Array
                      (
              [0] =&gt; Array(
                  [name] =&gt; php.exe
                  [type] =&gt; application/x-msdownload
                  [tmp_name] =&gt; C:\xampp\tmp\php455E.tmp
                  [error] =&gt; 0
                  [size] =&gt; 73728
              )
              [1] =&gt; Array(
                  [name] =&gt; php.gif
                  [type] =&gt; image/gif
                  [tmp_name] =&gt; C:\xampp\tmp\php456E.tmp
                  [error] =&gt; 0
                  [size] =&gt; 2523
              )
              [...] more data
  
                      )
  
              )
  
      )
  
  [...] other data
  </code></pre>
  
  <p>This way I only have to use foreach ($files as $file)</p>
  
  <p>Sorry for my bad English</p>