title: How to make sure that files on the server are not overwritten with files of the same name
body: <p>I've got an <code>asp:FileUpload</code> control to upload images to my server, which is local.</p>
  
  <p>It works well, however I decided to test what would happen if users upload an image which has the same file name as an existing image on the server.  The result is that the original image is overwritten by the new one.</p>
  
  <p>I thought of writing some code which would append a number at the end of the filename if the respective file already exists, however I believe that this is a bit flawed as a user may still be able to provide a file name with a number appended, thus still overwriting.</p>
  
  <p>What would be the best approach to solve this problem?</p>