- Refer the jquery.MultiFile.js
- Add a ASP.Net file upload control to the page
- Add the following code on the button click event for uploading the files
HttpFileCollection fileCollection = Request.Files;
for (int i = 0; i < fileCollection.Count; i++)
{
HttpPostedFile uploadfile = fileCollection[i];
string fileName = Path.GetFileName(uploadfile.FileName);
if (uploadfile.ContentLength > 0)
{
uploadfile.SaveAs(Server.MapPath("~/UploadedFiles/") + fileName);
lblMessage.Text += fileName + "Saved!!!";
}
}
No comments:
Post a Comment