Solved

Downloading files in ASP.NET using Response object

Posted on 2004-04-19
1
383 Views
Last Modified: 2012-05-05
Hi,
Iam using the Response object to download files. In the application, the user can select multiple files for download. But the code I wrote works fine only for a single download. i.e It downloads only the first selected file. Can somebody tell me how to download multiple files in one shot??
This is the code i wrote for downloading files:

        Response.Clear()
        Response.Buffer = True
        Response.ContentType = "application/octet-stream; name=" & Filename
        Response.AddHeader("content-transfer-encoding", "binary")
        Response.AddHeader("content-disposition", "attachment;filename=" & Filename & "")
        Response.ContentEncoding = System.Text.Encoding.GetEncoding(1251)

Thanks in advance
0
Comment
Question by:amiteshsinha
1 Comment
 
LVL 7

Accepted Solution

by:
culshaja earned 500 total points
ID: 10860062
I don't think you can. What you might be able to do is to open a page that invokes a JavaScript that opens up a window per download each with the URL that is required to start the download.

James :-)
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question