title: Add date stamp on uploaded file
body: <p>I'm currently developing a website using asp and c#. One of the pages allows registered users to upload files. These files get stored according to the user who is logged in. A directory is created when they hit upload with there login name and id. </p>
  
  <pre><code>string userDirectory = "\\Test\\Files\\ " + User.Identity.Name + " " + User.Identity.GetUserId();
  if (!Directory.Exists(userDirectory))
          {
              Directory.CreateDirectory(userDirectory);
          }
  </code></pre>
  
  <p>The directory gets created without an issue and file also gets uploaded. However the problem I am now facing is I'm trying to add a date stamp to a file if it already exist in the directory so I don't overwrite it. See the code below</p>
  
  <pre><code>string fileName = Path.Combine(userDirectory, FileUpload1.FileName);
  if (!File.Exists(fileName))
          {
              FileUpload1.SaveAs(fileName);
          }
          else
          {
              fileName = string.Concat(
              Path.GetFileNameWithoutExtension(fileName),
              DateTime.Now.ToString("_yyyy_MM_dd_HH:mm:ss"),
              Path.GetExtension(fileName)
              );
              FileUpload1.SaveAs(fileName);
          }
  </code></pre>
  
  <p>This keeps giving me an error:</p>
  
  <pre><code>System.Web.HttpException: The SaveAs method is configured to require a rooted path, and the path 'Test.docx' is not rooted
  </code></pre>
  
  <p>Does anyone know where I'm going wrong? Thanks in advance</p>