Problem in displaying PDFs on Google Chrome

Joined
May 12, 2011
Messages
2
Reaction score
0
Hello Everyone,

I have some PDF files saved in binary form in database. When I try to display these files on browser it just asks me to save the file as ".aspx" page. These PDFs are displayed fine in FireFox/IE and this ".aspx" Save as issue comes in Google Chrome only. For testing of my code I try to display the binary image files and images are displayed fine in Chrome but as soon as I start displaying the PDFs the Chrome just asks user to save .aspx page.

Also I dont want to download the PDF as attachment on user's system, I want to display it in browser itself. Please have a look at my code and suggest what wrong I am doing. This code is working as desired in FF and IE. The code is:

Response.ClearHeaders();
Response.ClearContent();
DataSet dspdf = new DataSet();
dspdf = SiteProvider.ClientConfiguration_Site.getpdffilebyname("Medicare");
byte[] bytedata;
bytedata = (byte[])dspdf.Tables[0].Rows[0]["pdfdata"];
Response.ContentType = "application/pdf";
Response.AddHeader("content-length", bytedata.Length.ToString());
Response.BinaryWrite(bytedata);
Response.End();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top