title: Multiple File / Image Uploads CakePHP 3
body: <p>How do I grab all the data for each file?</p>
  
  <p>I am not sure how to upload multiple files with CakePhp 3 syntax. I have seen posts for plugins, but I would like to know how to do it without having to use a plugin for a simple task.</p>
  
  <p>Here is my form:</p>
  
  <pre><code>&lt;div class="havesAndWants form large-10 medium-9 columns"&gt;
      &lt;?= $this-&gt;Form-&gt;create($havesAndWant, ['type' =&gt; 'file']) ?&gt;
      &lt;fieldset&gt;
          &lt;legend&gt;&lt;?= __('Add Haves And Want') ?&gt;&lt;/legend&gt;
          &lt;?php
              echo $this-&gt;Form-&gt;input('contact_name');
              echo $this-&gt;Form-&gt;input('contact_email');
              echo $this-&gt;Form-&gt;input('contact_phone');
              echo $this-&gt;Form-&gt;input('contact_street_address');
              echo $this-&gt;Form-&gt;input('contact_city');
              echo $this-&gt;Form-&gt;input('contact_state');
              echo $this-&gt;Form-&gt;input('contact_zip');
              echo $this-&gt;Form-&gt;input('ad_street_address');
              echo $this-&gt;Form-&gt;input('ad_city');
              echo $this-&gt;Form-&gt;input('ad_state');
              echo $this-&gt;Form-&gt;input('ad_zip');
              echo $this-&gt;Form-&gt;input('ad_additional_info', ['label' =&gt; 'Ad Description']);
              echo $this-&gt;Form-&gt;input('ad_photos', ['type' =&gt; 'file', 'multiple' =&gt; 'multiple', 'label' =&gt; 'Add Some Photos']);
          ?&gt;
      &lt;/fieldset&gt;
      &lt;?= $this-&gt;Form-&gt;button(__('Submit')) ?&gt;
      &lt;?= $this-&gt;Form-&gt;end() ?&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I can't seem to grab all of the data from the multiple files. It is grabbing the first file and spitting out the same info for each file even though they are different files.</p>
  
  <p>Controller:</p>
  
  <pre><code>$photos = $this-&gt;request-&gt;data['ad_photos'];
  foreach ($photos as $photo ) {
                  $photo = [
                      'name' =&gt; $this-&gt;request-&gt;data['ad_photos']['name'],
                      'type' =&gt; $this-&gt;request-&gt;data['ad_photos']['type'],
                      'tmp_name' =&gt; $this-&gt;request-&gt;data['ad_photos']['tmp_name'],
                      'error' =&gt; $this-&gt;request-&gt;data['ad_photos']['error'],
                      'size' =&gt; $this-&gt;request-&gt;data['ad_photos']['size']
                  ];
                  echo "&lt;pre&gt;"; print_r($photo); echo "&lt;/pre&gt;";
              }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Array
  (
      [name] =&gt; DPC.jpg
      [type] =&gt; image/jpeg
      [tmp_name] =&gt; C:\wamp\tmp\dpze123.tmp
      [error] =&gt; 0
      [size] =&gt; 2288982
  )
  Array
  (
      [name] =&gt; DPC.jpg
      [type] =&gt; image/jpeg
      [tmp_name] =&gt; C:\wamp\tmp\dpze123.tmp
      [error] =&gt; 0
      [size] =&gt; 2288982
  )
  Array
  (
      [name] =&gt; DPC.jpg
      [type] =&gt; image/jpeg
      [tmp_name] =&gt; C:\wamp\tmp\dpze123.tmp
      [error] =&gt; 0
      [size] =&gt; 2288982
  )
  Array
  (
      [name] =&gt; DPC.jpg
      [type] =&gt; image/jpeg
      [tmp_name] =&gt; C:\wamp\tmp\dpze123.tmp
      [error] =&gt; 0
      [size] =&gt; 2288982
  )
  Array
  (
      [name] =&gt; DPC.jpg
      [type] =&gt; image/jpeg
      [tmp_name] =&gt; C:\wamp\tmp\dpze123.tmp
      [error] =&gt; 0
      [size] =&gt; 2288982
  )
  </code></pre>
  
  <p>Notice how it is all the same info?</p>