Multiple file uploads

Posted by Anurag_Sharma4u under ASP.NET on 2/4/2013 | Points: 10 | Views : 2435 | Status : [Member] | Replies : 5
How to upload multiple files with single click without using flash, HTML5 or any thrid party control?
Is there any Jquery plugin which can be used to upload multiple files?

Regards
Anurag



Responses

Posted by: Kusumas on: 2/4/2013 [Member] Starter | Points: 25

Up
0
Down
Hi,

Use below JQuery Plug-in it will help you.

jquery-1.4.min.js
jquery.MultiFile.pack.js


Aspx:
<script src="jquery-1.4.min.js" type="text/javascript" language="javascript"></script>
<!-- Download the MultiFile upload jQuery plug in fromhttp://www.fyneworks.com/jquery/multiple-file-upload -->
<script language="javascript" src="jquery.MultiFile.pack.js" type="text/javascript"></script>
Select files to upload:
<asp:FileUpload ID="FileUpload1" runat="server" class="multi" accept="png|jpg|aspx" />
<p><asp:Button ID="Button3" runat="server" Text="Upload Files using jQuery" OnClick="jQueryUploadFiles" /></p>

C# Code:
protected void jQueryUploadFiles(object sender, EventArgs
{
HttpFileCollection files = Request.Files;
for (int i = 0; i < files.Count; i++)
{
HttpPostedFile file = files[i];
string path = Server.MapPath("~/");
string fileName = file.FileName;
if (file.ContentLength > 0)
{
// now save the file to the disk
file.SaveAs(path + fileName);
}
Response.Write(fileName + " uploaded successfully ! <br />");
}
}

also you use below .net code

Upload files<br />
<asp:FileUpload ID="FileUpload1" runat="server" /><br />
<asp:FileUpload ID="FileUpload2" runat="server" /><br />
<asp:FileUpload ID="FileUpload3" runat="server" /><br />
<asp:FileUpload ID="FileUpload4" runat="server" /><br />
<p><asp:Button ID="btnUpload" runat="server" Text="Upload Multiple Files" OnClick="UploadMultipleFiles" /></p>

C# code:
protected void UploadMultipleFiles(object sender, EventArgs e)
{
HttpFileCollection files = Request.Files;
for (int i = 0; i < files.Count; i++)
{
HttpPostedFile file = files[i];
string path = Server.MapPath("~/");
string fileName = file.FileName;
file.SaveAs(path + fileName);
Response.Write(fileName + " uploaded successfully ! <br />");
}
}



Anurag_Sharma4u, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Anurag_Sharma4u on: 2/4/2013 [Member] Starter | Points: 25

Up
0
Down
Hello Kusumas,

This is not the solution i am looking for, from this solution i have to select multiple files one by one, but i want to slect all the file together can upload them in single like, as file uploads works in Faceboox and hotmail through Jquery and asp.net without using flash,html5.

Regards
Anurag

Anurag_Sharma4u, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bhanubysani on: 2/4/2013 [Member] Starter | Points: 25

Up
0
Down
Hi Anurag,

You can upload multiple files like Gmail and Facebook using jquery.

Please find the below URL for your reference.

http://www.aspsnippets.com/Articles/Multiple-File-Uploads-Gmail-Style-using-JQuery-and-ASP.Net.aspx

http://blueimp.github.com/jQuery-File-Upload/

http://www.jquery4u.com/plugins/10-jquery-file-uploads/



Regards,
Bhanu Prakash Bysani

Anurag_Sharma4u, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rimi1289 on: 9/3/2013 [Member] Starter | Points: 25

Up
0
Down
Asp.Net 2.0 have multiple file upload options with the use of HttpFileCollection.
See here http://www.encodedna.com/2013/02/multiple-file-upload-in-aspdotnet.htm

If in any case your browser or version does not support multiple uploads, in that case you can use a JQuery plugin. It comes with many interesting features.
Multiple file upload using JQuery Plugin. http://www.encodedna.com/2013/09/multiple-fileupload-using-jquery-aspdotnet.htm

Anurag_Sharma4u, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Poisy on: 9/5/2013 [Member] Starter | Points: 25

Up
0
Down
do you mean that load image from file using vb?If so ,you can check the link.If I don;t get the point, you can search the pages from that site. It is a pro vb solution for image processing. hope you can get something helpful.
http://www.rasteredge.com/how-to/vb-net-imaging/load-from-file/

Anurag_Sharma4u, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response