title: asp.net fileupload control, uploading file to ftp
body: <p>I'm trying upload a file via asp.net forms. Problem is when i use FileUpload control to get path to the file a got just name of file, not full path. And to upload a file to ftp i need a full path. Can i achieve this somehow ?</p>
  
  <p>form code:</p>
  
  <pre><code>&lt;div align="center"&gt;
              &lt;asp:FileUpload id="FileUploadControl" runat="server" Width="600px" /&gt;
              &lt;br /&gt;
              &lt;asp:Button ID="btnUpload" runat="server" Text="Upload" OnClick="btnUpload_Click" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>button click code:</p>
  
  <pre><code>protected void btnUpload_Click(object sender, EventArgs e)
          {
              if(FileUploadControl.FileName != null)
              {
                  string filename = Path.GetFileName(FileUploadControl.FileName);
                  //MessageBox.Show(this, Server.MapPath(FileUploadControl.FileName));
  
  
              var temp = ftp + ftpFolder + Path.GetFileName(FileUploadControl.FileName);
  
              try
              {
                  using (WebClient client = new WebClient())
                  {
                      client.Credentials = new NetworkCredential(loginName, password);
                      client.UploadFile(temp, "STOR", FileUploadControl.FileName); // ???
                  }
              }
              catch (Exception ex)
              {
                  Console.WriteLine(ex.StackTrace);
              }
  
              }
  
          }
  </code></pre>
  
  <p>it's not nessesary to use FileUpload, but i need something where user can choose file from folder and it give me full path.</p>