Archive for May, 2011

ASP.NET File Upload and Download

ASP.NET File Uploader is an easy to use control. Just drag and drop the control on your page and write this code snippet at Button Click Event to upload the file.


if (studentFileUpload.HasFile == true)
{
  string filename = Path.GetFileName(studentFileUpload.FileName);
  studentFileUpload.SaveAs(Server.MapPath("~/DataFile/") + filename);
}

Continue reading