How to download multi files in asp.net in form load?

Posted by Prabu_Spark under ASP.NET on 8/5/2013 | Points: 10 | Views : 6806 | Status : [Member] | Replies : 4
Hi sir,
Tell me the steps to download multi files using asp.net c#. I stored the filenames in string array and put in for loop, but for loop is going one time only. i attached the code for your reference. Kindly give me the solution for this problem.


[Note: Because of Response.End() it will not go to next value increment in for loop]


protected void Page_Load(object sender, EventArgs e)
{
string[] values = { "setup1.apk", "setup1.apk" };

for (int i = 0; i < values.Length; i++)
{
downloadfiles(values[i]);
}

}

private void downloadfiles(string filename)
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ClearContent();
Response.Clear();
Response.ContentType = "application/msi";
Response.AppendHeader("Content-Disposition", "attachment; filename=" + filename);
Response.TransmitFile(Server.MapPath("~/jad/") + filename);

Response.End();

}

With regards,
J.Prabu.
[Email:prbspark@gmail.com]



Responses

Posted by: Jprathap on: 8/5/2013 [Member] Starter | Points: 25

Up
0
Down
this article is very useful for u :
click this link: http://www.aspdotnet-suresh.com/2013/04/aspnet-download-multiple-files-as-zip.html

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

Posted by: Prabu_Spark on: 8/5/2013 [Member] Starter | Points: 25

Up
0
Down
Hi Jprathap,
I dont want in zip format, i need as a separater files.

With regards,
J.Prabu.
[Email:prbspark@gmail.com]

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

Posted by: Jprathap on: 8/6/2013 [Member] Starter | Points: 25

Up
0
Down
ok try this link now:

http://www.aspdotnet-suresh.com/2013/04/extract-unzip-files-in-zip-folder-in.html

http://www.aspdotnet-suresh.com/2013/04/extract-unzip-files-in-zip-folder-in.html



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

Posted by: Rimi1289 on: 8/6/2013 [Member] Starter | Points: 25

Up
0
Down
Multiple file upload in Asp.Net. You should Googled this and it would have come up with many article and tutorials.
Anyways, just check this out.

http://www.encodedna.com/2013/02/multiple-file-upload-in-aspdotnet.htm

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

Login to post response