Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3239998
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:02:07+00:00 2026-05-17T18:02:07+00:00

Greatings! I’m working on a reporting script which runs a number of reports (pdf)

  • 0

Greatings!

I’m working on a reporting script which runs a number of reports (pdf) on button click. The reports are created on the web server then I’d like the user to be given the option to download the files. I have worked out the script for downloading one file from the server. But I’m not sure how to download multiple files? (there will probably be about 50)

After I run one report I redirect the user to a http handler script.

Response.Redirect("Download.ashx?ReportName=" + "WeeklySummary.pdf");

public class Download : IHttpHandler {


public void ProcessRequest(HttpContext context)
{


   StringBuilder sbSavePath = new StringBuilder();
   sbSavePath.Append(DateTime.Now.Day);
   sbSavePath.Append("-");
   sbSavePath.Append(DateTime.Now.Month);
   sbSavePath.Append("-");
   sbSavePath.Append(DateTime.Now.Year);

    HttpContext.Current.Response.ClearContent();
    HttpContext.Current.Response.ContentType = "application/pdf";
    HttpResponse objResponce = context.Response;
    String test = HttpContext.Current.Request.QueryString["ReportName"];
    HttpContext.Current.Response.AppendHeader("content-disposition", "attachment; filename=" + test);
    objResponce.WriteFile(context.Server.MapPath(@"Reports\" + sbSavePath + @"\" + test));    
    HttpContext.Current.Response.Flush();
    HttpContext.Current.Response.Clear();
    HttpContext.Current.Response.End();

}
public bool IsReusable { get { return false; } } 

}

Thanks in advance, please let me know if you’d like to see any more of my script.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T18:02:07+00:00Added an answer on May 17, 2026 at 6:02 pm

    The 2 options I see right away is the obvious one to simply call the HTTP Handler repeatedly. Another one would be to zip them on the server and send a zip file across the wire. You could use the built in GZipStream class to accomplish this.

    Also, you’ll want to add some code in your handler to clean up those temp files once they’re downloaded.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Greetings I've been working on a homework in which I must create a linked
Greatings everyone! I have some images (100x100) . Depending on the number of results
Greetings! I'd like to build an apache web server, running on debian lenny. It
Greetings! I have a Repeater control that's using an XmlDataSource control. <asp:FormView id=myFormView runat=server
Greetings , I am a new developer in BlackBerry Application. I have been working
Greetings! This is my first question. I've searched all over the web as well
Greetings, I've taken over from a prior team and writing ETL jobs which process
Greetings everyone. Can any one has a working example for the CoreTelephony framework? I
Greetings, I have a view based application project where I have created an NSObject
Greetings! I am working on an AS2 website with MovieClips for pages that swap

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.