467,885 Members | 1,279 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,885 developers. It's quick & easy.

Multiple File Download in ASP.NET


Hi All,

I want to download two or more file to user machine.
Any one have idea.. How to download multiple file in user machine.

When I tried to download two file using below code.
I am not able to do...plz advise...............

Response.ContentType = "application/vnd.msword";
Response.AddHeader("content-disposition", "attachment;filename=" +
"Download_View.doc");

byte[] l_bytBinaryData;
string l_strBase64string = GetBase64String("C:\\Download_View.doc");
l_bytBinaryData = System.Convert.FromBase64String(l_strBase64string) ;
Response.BinaryWrite(l_bytBinaryData);

I used this two time, but this does not work and download one file.
Can anyone tell me.. how to proceed.
May 23 '06 #1
  • viewed: 1656
Share:
1 Reply
You can only return 1 stream of data, be it text (html) or binary (files).
You can't return 2 streams within a single request/response.

In my opinion, your best bet is to zip the 2+ files together using something
like SharpZipLib (free, http://www.icsharpcode.net/OpenSource/SharpZipLib/)
and returning the zip.

Karl

--
http://www.openmymind.net/

"vivek" <vi***@discussions.microsoft.com> wrote in message
news:AB**********************************@microsof t.com...

Hi All,

I want to download two or more file to user machine.
Any one have idea.. How to download multiple file in user machine.

When I tried to download two file using below code.
I am not able to do...plz advise...............

Response.ContentType = "application/vnd.msword";
Response.AddHeader("content-disposition", "attachment;filename=" +
"Download_View.doc");

byte[] l_bytBinaryData;
string l_strBase64string = GetBase64String("C:\\Download_View.doc");
l_bytBinaryData = System.Convert.FromBase64String(l_strBase64string) ;
Response.BinaryWrite(l_bytBinaryData);

I used this two time, but this does not work and download one file.
Can anyone tell me.. how to proceed.

May 23 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Billy Jacobs | last post: by
2 posts views Thread by Ivo Tcholakov | last post: by
2 posts views Thread by moondaddy | last post: by
1 post views Thread by RJN | last post: by
5 posts views Thread by Stanav | last post: by
35 posts views Thread by keerthyragavendran | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.