file upload to the wrong directory
<p>I try to use the copy() function in php to store two same files in the sever at one time, I have specified the directory for the copied file, but it doesn't go to the directory I specified which is "edituploads" folder, instead it goes to the current directory which the upload php scrpit is located. and I have used the copy() function three times , is that a problem?
Any one could tell me what's wrong, thanks alot.</p>

<p>here is my php code:</p>

<pre><code>  if (!empty($_FILES))
  {
      $a = uniqid();
      $tempFile = $_FILES['Filedata']['tmp_name'];
      $targetpath4=$_SERVER['DOCUMENT_ROOT']."/example/upload/edituploads/";
      $targetFile =  str_replace('//','/',$targetPath) . $a.".jpg";
      $targetFile4 =  str_replace('//','/',$targetPath4) . $a.".jpg"; 
      move_uploaded_file($tempFile,$targetFile);
      copy($targetFile, $targetFile4);
   }
</code></pre>
