PDF does not open in IE9 only but opens in Chrome & Firefox/IE8/IE10

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi All,
Unable to open pdf only in IE9(works in IE8/IE10/Chrome/Firefox).
Here is the code snippet I have used,
response.Clear();
response.ClearHeaders();
response.ClearContent();
response.Buffer = true;
response.AddHeader("Content-Disposition", "attachment; filename="+ id +"_PD.pdf; size= " + pdf.Length.ToString());
/*response.ContentType = "application/pdf";*/
response.ContentType = "application/octet-stream";
response.AppendHeader("Content-Length", pdf.Length.ToString());
response.AddHeader("Cache-Control", "public, max-age=1800");
response.AppendHeader("Accept-Ranges", "none");

response.Expires = -1;
response.Charset = string.Empty;

response.BinaryWrite(pdf);

response.End();
Thanks,
Prashanth
Kaluvalakp

View the full article
 
Back
Top