protected void btnUpload_Click(object sender, EventArgs e) { if (FileUpload1.HasFile == false) { UplodDetails.Text = "Please first select a file to upload..."; } else { UplodDetails.Text = string.Format(@"Uploaded file: {0}<br />File size (in bytes):{1:N0}<br />Content-type: {2}", FileUpload1.FileName, FileUpload1.FileBytes.Length, FileUpload1.PostedFile.ContentType); string filePath = Server.MapPath("~Uploader" + FileUpload1.FileName); FileUpload1.SaveAs(filePath); }
if (!Directory.Exists(Server.MapPath(filePath))) { Directory.CreateDirectory(Server.MapPath(filePath)); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)