title: Copy uploaded image to another folder
body: <p>I am having a small issue that would love to get some assistance on, I have a image upload that I am building and would like to move the file to a folder <strong>image</strong> and copy it to a folder <strong>image_thumb</strong> also. I am using arrays with keys but when I try to add the copy() function it gives an error saying that it failed to open stream.</p>
  
  <p>It manages to upload the image to <strong>image</strong> folder, but not the other one, could someone tell me what I did wrong in the <strong>copy($key, "image_thumbnail/" . $_FILES['images']['name'][$i]);</strong> function.</p>
  
  <p>Thank you for the awesome upcoming assistance :) </p>
  
  <p>Here is my code</p>
  
  <pre><code>&lt;?php
  if (isset($_POST['addpart'])) {
  
      $image = $_FILES['images']['tmp_name'];
      $i     = 0;
      foreach ($image as $key) {
          move_uploaded_file($key, "image/" . $_FILES['images']['name'][$i]);
          copy($key, "image_thumbnail/" . $_FILES['images']['name'][$i]);
          $i++;
      }
      echo 'Uploaded';
      echo '&lt;hr&gt;';
  
  }
  ?&gt;
  </code></pre>