title: How we can insert absolute path using fileupload control in ASP.NET
body: <p>I am using <em>file upload</em> control using ASP.NET and I want to insert a absolute path into a database from <em>localhost</em> - like:-<a href="http://www.webcheck.co.in/rancMeUpload/hello.jpg" rel="nofollow">http://www.webcheck.co.in/rancMeUpload/hello.jpg</a>.</p>
  
  <p>When i am trying to do this it shows a exception:</p>
  
  <blockquote>
    <p>'http:/www.webcheck.co.in/rancMeUpload/Jellyfish.jpg' is not a valid virtual path.</p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre><code>protected void submitButton_Click(object sender, EventArgs e)
  {
      if (imageFileUpload.HasFile)
      {
          string str=imageFileUpload.FileName;
          imageFileUpload.SaveAs(Server.MapPath(@"http://www.webcheck.co.in/rancMeUpload/"+str));
          string name="http://www.webcheck.co.in/rancMeUpload/"+str;
  
          int num = UseDetails.inserttechtpdate("inserttechupdates", titleTextBox.Text, descTextBox.Content , name, referenceTextBox.Text, postedByTextBox.Text);
          if (num &gt; 0)
          {
              ScriptManager.RegisterStartupScript(this, this.GetType(),"Message", "alert('Done');", true);
          }
      }
  }
  </code></pre>