title: changing name of uploaded images
body: <p>What I am trying to achieve is changing the name of uploaded images to a somewhat unique string.</p>
  
  <p>I have created an image gallery which is populated dynamically by database. The gallery is working fine except, that files stored in the database will be problematic if an image with the same name is uploaded!</p>
  
  <p>Code in the controller for file upload:</p>
  
  <pre><code>string AdvertImage = picture1.FileName;
                      advert.AdvertImage = AdvertImage;
                      var image1Path = Path.Combine(Server.MapPath("~/Content/Images"), AdvertImage);
                      picture1.SaveAs(image1Path);
  </code></pre>
  
  <p>The code below is what I am working on</p>
  
  <pre><code>                    string BackImage = DateTime.Now.ToString("yyyyMMddhhmmssfffffff");
                      caradvert.BackImage = BackImage;
                      var image3Path = Path.Combine(Server.MapPath("~/Content/CarImages"), BackImage);
                      picture3.SaveAs(image3Path);
  </code></pre>
  
  <p>I have managed to create a unique file name thou it is not appending .jpg to the end of the image.</p>
  
  <p>Any help or advice on the subject welcome</p>