Herewith I have explained and given the code for multiple file upload using jquery.
We know all the normal upload functionality. But someone of us wants the multiple file upload in .NET. Here jquery makes that very easy.
We just use the same asp:fileupload control. If you want to accept only jpg,png only you no need to go for a customvalidator tocheck the file extension. You just add the accept="jpg|png". Thats it. It allows only files which has the extension of above.
Ok let us see the code below,

HEAD SECTION:
<script src="Scripts/jquery-1.3.2.js" type="text/javascript"></script>
<script src="Scripts/jquery.MultiFile.js" type="text/javascript"></script>
 
BODY TAG:
<div>

<asp:FileUpload ID="fupImage" runat="server" class="multi" accept="" />
<br />
<asp:Button ID="btnUpload" runat="server" Text="Upload All" OnClick="btnUpload_Click" />
</div>

Thats it about in the UI page(aspx).
Let us see the code behind page,

the following code should be inside in the upload button event,

try

{
// Get the HttpFileCollection
HttpFileCollection hfc = Request.Files;
Guid newid = new Guid();
newid = System.Guid.NewGuid();
for (int i = 0; i < hfc.Count; i++)
{
HttpPostedFile hpf = hfc[i];
if (hpf.ContentLength > 0)
{
hpf.SaveAs(Server.MapPath("Files") + "\\" +
System.IO.Path.GetFileName(newid + hpf.FileName));
Response.Write("Uploaded Successfully <br/>");
}
}
}
catch (Exception ex)
{
// ERROR OCCURED
}
 
Feel free to post your comments here!... If any one wants the whole solution post your mailid here. I will send mail to you personally.....
 
“You have to dream before your dreams can come true.” - A P J