title: I want php upload image form to check filename and, if it exists, ask if I want to overwrite
body: <p>I have a php form where multiple images care uploaded.  The file names are checked against the current folder and if there is a match it stops, here's a simplified version of what goes on:</p>
  
  <pre><code>if (file_exists("../uploads/" . $_FILES["file"]["name"][$i])){
      echo "sorry that one already exists, rename";
  }else{
      move_uploaded_file($_FILES["file"]["tmp_name"][$i],"" . '../uploads/'.$_FILES["file"]["name"][$i]);
      echo $_FILES["file"]["name"][$i]." was uploaded";
  }
  </code></pre>
  
  <p>What I want is to ask "do you want to overwrite the existing file"?  If they are OK with it, then proceed with move_uploaded_file().  This could be a pop-up or whatever.  What is the best way to do this?</p>