title: how to get the full path of file upload control in asp.net?
body: <p>i am using asp.net 2.0 in my project using file upload control , so browse the drive and select <strong>the file like path(D:\user doc new 2011\Montana\MT_SUTA_2010-2011.html)</strong>
  but in my code seeing error is could not find the file path is
  <strong>(D:\Paymycheck\OnlineTaxUserDocumentation-1\TaxesDocument\MT_SUTA_2010-2011.html)</strong> actually it is application path and take the filename only my code is</p>
  
  <pre><code>if (FileUpload.HasFile)
          {
  string filepath = Server.MapPath(FileUpload.FileName);
  string strHTML = File.ReadAllText(filepath);
                  System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
                  byte[] file1 = encoding.GetBytes(strHTML);
                  int len = file1.Length;
                  byte[] file = new byte[len]; 
  
                  docs.TaxAuthorityName = ddlTaxAuthority.SelectedItem.Text;
                  docs.TaxTypeID = ddlTaxType.SelectedValue;
                  docs.TaxTypeDesc = ddlTaxType.SelectedItem.Text;
                  docs.EffectiveDate = Convert.ToDateTime(txtEffectiveDate.Text);
  
                  docs.FileName = f1;
                  if (ddlTaxAuthority.SelectedValue == "FD")
                  {
  
                      docs.Add(strHTML, file1);
                  }
  }
  </code></pre>
  
  <p>error occoured in this line</p>
  
  <pre><code>string strHTML = File.ReadAllText(filepath);
  </code></pre>
  
  <p>i can try like this also</p>
  
  <pre><code>string FolderToSearch = System.IO.Directory.GetParent(FileUpload.PostedFile.FileName).ToString();
  string f = Path.GetDirectoryName(FileUpload.PostedFile.FileName);
  string f1 = FileUpload.FileName;
                   string filepath = System.IO.Path.GetFullPath(FileUpload.PostedFile.FileName);
   string strFilePath = FileUpload.PostedFile.FileName;
  string file1234 = System.IO.Path.GetFullPath(FileUpload.PostedFile.FileName);
  string filepath = FileUpload.PostedFile.FileName;
  </code></pre>
  
  <p>so how to get the total path drive to file 
  pls help me any one</p>
  
  <p>thank u
  hemanth</p>