title: Zend Framework 2 - How to upload multiple files?
body: <p>How to upload multiple files in Zend Framework 2. I have done this work. But, i got the following error for second file.</p>
  
  <pre><code>'first-filename' was illegally uploaded. This could be a possible attack. 
  </code></pre>
  
  <p>For your reference,</p>
  
  <pre><code>            $size   = new Size(array('max' =&gt; 1048576));
              $adapter= new \Zend\File\Transfer\Adapter\Http(); 
              $File    = $this-&gt;params()-&gt;fromFiles('logo');
              $adapter-&gt;setValidators(array($size), $File['name']);
              $FileName   = '';
  
              if (!$adapter-&gt;isValid()){
                  $dataError = $adapter-&gt;getMessages();
                  $error = array();
                  foreach($dataError as $key=&gt;$row)
                  {
                      $error[] = $row;
                  }
              } else {
                  $adapter-&gt;setDestination(path);
                  if ($adapter-&gt;receive($File['name'])) {
                      // manipulation
                  }
              }
  
              $logoFile   = $this-&gt;params()-&gt;fromFiles('logo2');
              $adapterLogo    = new \Zend\File\Transfer\Adapter\Http(); 
              $adapterLogo-&gt;setValidators(array($size), $logoFile['name']);
              $logoFileName= '';
  
              if (!$adapterLogo-&gt;isValid()){
                  $dataError = $adapterLogo-&gt;getMessages();
                  $error = array();
                  foreach($dataError as $key=&gt;$row)
                  {
                      $error[] = $row;
                  }
              } else {
                  $adapterLogo-&gt;setDestination(path2);
                  if ($adapterLogo-&gt;receive($logoFile['name'])) {
                      // manipulation
                  }
              }
  </code></pre>
  
  <p>How can i solve this issue? Why this error occurred? </p>