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

  • Home
  • SEARCH
  • 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 6129993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:48:24+00:00 2026-05-23T16:48:24+00:00

Current situation I have ASP.NET web application that render PDF for users using MS

  • 0

Current situation

I have ASP.NET web application that render PDF for users using MS Report Viewer. The PDF is rendered with this method:

    Byte pdfByte = Byte();
    pdfByte = ReportViewer.LocalReport.Render("PDF", Nothing, mimeType, encoding, extensions, stream, warning)

And send to browser as an attachment with response object:

    Response.Clear()
    Response.ContentType = mimeType
    Response.AddHeader("content-disposition", "attachment; filename=myfile." + extension)
    Response.BinaryWrite(pdfByte)
    Response.Flush()
    Response.End()

This work great! The user browser will get the PDF as download-able attachment.

What I am trying to achieve

Render multiple PDF and send all of them separately to user’s browser. User will get separate PDF documents. It doesn’t matter whether they will get them all at once or one by one.

The problem

The problem is after Response.End() the next line of code is not executed. I have tried to store the pdfByte object in session, looping through it and send them to user’s browser with Response object but after the first PDF get sent then it stop.
I have also tried removing Response.End() thinking the code will keep running but still it stop after the first PDF get sent.

Please advice any workaround or tips. Thanks!

  • 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-23T16:48:24+00:00Added an answer on May 23, 2026 at 4:48 pm

    You cannot send multiple files (as separate entities) in a single HTTP response (the protocol does not support it. However, what you can do is to archive all files together and send the that single zip (or whatever format you want) to the client.

    You can use libraries such as DotNetZip/SharpZipLib to combine (and compress) files together. Based on library API, you may need to save PDF files to disk before adding to zip file. Also do not forget to change your content type appropriate while sending the zip file to client.

    Yet another alternative is to provide user with a page having multiple links to download files. It may mean that you either have to store your PDFs for some time so that they can served later (via links) or make link point to a handler that will re-run the report again to get the PDF out of it.

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

Sidebar

Related Questions

Situation:I have an ASP .NET application that will search through docs using Lucene. I
I have a custom MembershipProvider that I'm using in an ASP.NET 2.0 application. Inside
I have a handler (c#/asp.net) that pulls images from a database. The current format
I have the following situation: excel-like application, that is accessible from internet. 2 users
I have an ASP.NET site that I am maintaining. Currently it has code that
The current situation is as follows: We have an production .net 3.5 WCF service,
I have a wizard in my asp.net MVC application which is built upon this
Have just started playing with ASP.NET MVC and have stumbled over the following situation.
Brief introduction: I have this ASP.NET Webforms site with the particularity that it doesn't
I have a strange situation on a production server. Connection for asp.net get queued

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.