title: Uploading a File from local hard drive to a folder on a website from a winform using WebClient
body: <p>When i choose a file from the OpenFileDialog, then it takes the FileName as "D:\myfile.txt".But i want only the filename, not the drive or path, so that i could pass it to the WebClient object. </p>
  
  <p>How to get only the filename excluding the rest of the path of the local drive.</p>
  
  <p>Also, what <strong>DESTINATION *<em>URI</em>*</strong> shall i give to the WebClient object.</p>
  
  <p>my web url is : www.myweb.com
  I want to upload in the folder: www.myweb.com\products\productinvoices\</p>
  
  <pre><code>    private void button2_Click(object sender, EventArgs e)
      {
  
          openFileDialog1.Filter = "Image Files (*.jpg)|*.jpg|(*.png)|*.png|" +
                              "All Files (*.*)|*.*";
          openFileDialog1.FilterIndex = 1; // set on Word Files (*.doc)
  
          openFileDialog1.ShowDialog();
          openFileDialog1.CheckFileExists = true;
          button2.Text = openFileDialog1.FileName.ToString();
  
  
          myWebClient.UploadFile(@"**www.myweb.com\products\productinvoices\", openFileDialog1.FileName**);           
  
  }
  </code></pre>
  
  <p>Its giving error : Could not find a part of the path..............</p>