Just a quickie to show how to use the FileUpload control in ASP.Net.
The following is the click event of a button called btnUpload. The only catch-me-out is that you need to make sure that sufficient rights have been granted to the folder which you want to upload the files to, for the ASP.Net user.
protected void btnUpload_Click(object sender, EventArgs e)
{
string fn = System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName);
string SaveLocation = Server.MapPath("d:\\Data\\Uploads") + "\\" + fn;
try
{
FileUpload1.PostedFile.SaveAs(SaveLocation);
}
catch (Exception ex)
{
Response.Write("Error: " + ex.Message);
}
}