In an ASP.NET 2.0 application using Google Chrome 13 on Windows.
My application dynamically generates a PDF report when a user views a particular aspx page. For the most part, everything works fine in different browsers.
However, in Chrome, when using the Chrome PDF viewer, the following may happen: - the user clicks the floating disk icon in the lower right of the viewer to save the PDF. The file is saved with the aspx page name. e.g. Report.aspx.
If I open the downloaded aspx file in Adobe Reader, it will open as a PDF document. But is there a way to get the default chrome filename for saving in order to have the extension β.PDFβ?
EDIT:
The code for the report page looks something like this:
protected void Page_Load(object sender, EventArgs e) { Response.Clear(); Response.ContentType = "application/pdf"; byte[] data = GenerateReportHere();
Note that I do not want to use the "Content-Disposition" header, for example:
Response.AddHeader("Content-Disposition", "attachment; filename=Report.pdf");
as this causes the browser to ask the user if he wants to download the file. In Chrome, it does not display it in its PDF viewer - it simply gives the user the option, after downloading, to open the file using any program associated with the .pdf file extension.
source share