473,385 Members | 1,983 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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
1 1815
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Billy Jacobs | last post by:
Is there a way to download multiple files from a server? If not then: How do I zip up multiple files using the .net classes in vb? Thanks Billy Jacobs
2
by: Ivo Tcholakov | last post by:
Hello, I created an application where the users need to download files. I have the list of the files stored in a database and I present the list to download in a Datagrid. Here comes my question....
2
by: moondaddy | last post by:
I have a asp.net app where a user will need to download multiple files at once. Below is some sample code I'm using to download a single file which works perfectly, however, rather than a single...
1
by: RJN | last post by:
Hi Sorry for posting this again. Requirement is to allow the user to download multiple files at once from browser. User will be displayed a grid on the browser which will list the various files...
5
by: Stanav | last post by:
Hello all, Thanks in advance for any replies... Now, my question is: Is it possible to do a multiple files download for a single response event on an aspx page? If there is, please give me some...
1
by: Ryan Malone | last post by:
I have a situation where I need to download multiple files in a vb.net application. To speed up the process, I am trying to download multiple files at one time looping through each of the files...
35
by: keerthyragavendran | last post by:
hi i'm downloading a single file using multiple threads... how can i specify a particular range of bytes alone from a single large file... for example say if i need only bytes ranging from...
2
by: ghart | last post by:
Hello all, I have been trying to determine the best way to do this, but can't seem to get any solution to work exactly the way I want. The scenario is that I have some xml files being placed on...
3
by: dynamo08 | last post by:
Hi, I am new to socket programming, I wrote an ftpclient which connects to an ftp server and downloads a file to the client computer. Now in one client connection I want to download multiple files...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.