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 6528373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:31:42+00:00 2026-05-25T09:31:42+00:00

In an ASP.NET 2.0 application, using Google Chrome 13 on Windows. My app dynamically

  • 0

In an ASP.NET 2.0 application, using Google Chrome 13 on Windows.

My app dynamically generates a PDF report when the user browses to a particular aspx page. For the most part, things work fine on various browsers.

However, on Chrome, when Chrome’s PDF viewer is being used, the following can happen :
– the user presses the floating diskette icon on the bottom right hand side of the viewer to save the PDF document. The file is saved with the aspx page’s name. e.g. Report.aspx .

If I open that downloaded aspx file in Adobe Reader, it opens up ok as a PDF document. But is there a way to get chrome to default the name of the file to save to have a “.PDF” extension ?

EDIT :

The code for the report generation page looks something like this :

protected void Page_Load(object sender, EventArgs e)
{
    Response.Clear();
    Response.ContentType = "application/pdf";
    byte[] data = GenerateReportHere(); // dynamically generate PDF report

    Response.AddHeader("Content-Length", data.Length.ToString());

    Response.BinaryWrite(data);
    Response.Flush();
    Response.End(); 
}

Note that I don’t want to use a “Content-Disposition” header like :

    Response.AddHeader("Content-Disposition", "attachment; filename=Report.pdf");

because that causes the browser to ask the user if they want to download the file. In Chrome it won’t display it in its PDF viewer – just gives the user the chance after downloading to open the file using whatever program they have associated with the “.pdf” file extension.

  • 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-25T09:31:43+00:00Added an answer on May 25, 2026 at 9:31 am

    You should try using content-disposition header while streaming the PDF file to the browser. For example,

    HttpContext.Current.Response.AddHeader("content-disposition", "attachment; filename=[ReportName].pdf");
    
    // Code to stream pdf file content to the client
    ...
    

    For more info about content disposition, see

    • http://www.jtricks.com/bits/content_disposition.html
    • http://greenbytes.de/tech/webdav/draft-reschke-rfc2183-in-http-latest.html
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm in a ASP.NET application using Windows Authentication. I'm using HttpContext.Current.User.Identity.Name to get the
I developing ASP.NET application using a Swedish version of Windows XP and Visual studio
I am developing web-application using Google Maps API and ASP.NET Ajax. Here is my
I want to test ASP.NET application using NUnit, but it seems WebConfigurationManager.ConnectionStrings collection is
In my ASP.NET application using InProc sessions, Session_End calls a static method in another
I have an ASP.NET application using the Telerik Q1 2009 controls. I have a
Example scenario in an ASP.NET application using SQL Server membership provider : 1) a
I am using SqlMetal to general my DataContext.dbml class for my ASP.net application using
I'm running into a case where an ASP.NET application using the built-in globalization facilities
I'm having a really frustrating error trying to secure an ASP.NET application using the

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.