title: CakePHP multiple file upload field only uploading one image
body: <p>I am trying to upload some files using the multiple upload file field. The POST information gets sent correctly and looks like this:</p>
  
  <pre><code>Array
  (
      [Uploads] =&gt; Array
          (
              [photos] =&gt; Array
                  (
                      [0] =&gt; Array
                          (
                              [name] =&gt; image - Copy - Copy.jpg
                              [type] =&gt; image/jpeg
                              [tmp_name] =&gt; /tmp/phpALAMwT
                              [error] =&gt; 0
                              [size] =&gt; 60892
                          )
  
                      [1] =&gt; Array
                          (
                              [name] =&gt; image - Copy.jpg
                              [type] =&gt; image/jpeg
                              [tmp_name] =&gt; /tmp/phpoIGtta
                              [error] =&gt; 0
                              [size] =&gt; 60892
                          )
  
                      [2] =&gt; Array
                          (
                              [name] =&gt; image.jpg
                              [type] =&gt; image/jpeg
                              [tmp_name] =&gt; /tmp/phpERTogu
                              [error] =&gt; 0
                              [size] =&gt; 60892
                          )
  
                  )
  </code></pre>
  
  <p>And i loop through and insert each one into the database, then upload them using the ID from the database, like this:</p>
  
  <pre><code>// Upload Photos
  if (!empty($this-&gt;request-&gt;data['Uploads']['photos'][0]['tmp_name'])){
  
      foreach($this-&gt;request-&gt;data['Uploads']['photos']as $photo){
  
          $property_id = $this-&gt;request-&gt;data['Property']['ID'];
          $file_name = $photo['name'];
          $file_size = $photo['size'];
          $file_ext = pathinfo($photo['name'], PATHINFO_EXTENSION);
  
          // Save to DB
          $this-&gt;Property-&gt;PropertyImage-&gt;save(array(
              'PropertyImage' =&gt; array("Live"=&gt;1, 'Number'=&gt;99, "Type"=&gt;'L', "FileType"=&gt;$file_ext, "PropertyID"=&gt;$property_id, 'Source'=&gt;$file_name, 'Size=&gt;'.$file_size)
          ));
  
          // Upload
          $id = $this-&gt;Property-&gt;PropertyImage-&gt;getLastInsertID();
          $path = intval($id/1000) . '/' . $id . '.' . $file_ext;
          move_uploaded_file($photo['tmp_name'], $_SERVER['DOCUMENT_ROOT'].'/imgp/F/'.$path);
  
      }
  }
  </code></pre>
  
  <p>But only one image gets put into the database and uploaded each time, cant work out why the look isn't working right.</p>
  
  <p>Any ideas? Thanks.</p>