How to upload a file with a different file name
<p>I have a file input known as 'name=fileImage'. Now I have php code below where it checks to see if file exists in the folder (ImageFiles) or not:</p>

<pre><code>if (file_exists("ImageFiles/" . $_FILES["fileImage"]["name"]))
  {

  }
</code></pre>

<p>My question is that if a file does exist in the folder, how can it be coded so that it still uploads the file but it gives it a different file name. Maybe something like automatically add a number at the end of the filename to give it a different file name?</p>
