Solved

Error opening pdf file using ie6 but it works in ie7

Posted on 2009-04-14
4
508 Views
Last Modified: 2013-11-07
Hi

I have a link the shows a pdf file. It works fine in ie7 and ff but not in ie6. I can only get it to work in ie6 if i save the file first then open.

Any help would be appreciated (Code below)
Response.ClearContent();
            Response.AddHeader("Content-Disposition", string.Format("attachment; filename={0}", file.Name));
            Response.AddHeader("Content-Length", file.Length.ToString());
            Response.ContentType = "application/pdf";
            Response.TransmitFile(file.FullName);
            Response.End();

Open in new window

0
Comment
Question by:acadenilla
  • 2
4 Comments
 
LVL 29

Assisted Solution

by:David H.H.Lee
David H.H.Lee earned 100 total points
ID: 24144529
Hi acadenilla,
Try open the pdf file via "inline" mode instead of "attachment".
eg:
 Response.AddHeader("Content-Disposition", string.Format("inline; filename={0}", file.Name));
           
0
 
LVL 3

Expert Comment

by:OmerFarukZ
ID: 24145220
Response.Buffer = True
Response.AddHeader("content-disposition", "attachment; filename=file_long_name.pdf");
Response.ContentType = "application/ms-excel";
0
 
LVL 3

Assisted Solution

by:OmerFarukZ
OmerFarukZ earned 100 total points
ID: 24145223
Sorry, please change this line

Response.ContentType = "application/ms-excel";

To

Response.ContentType = "application/octet-stream";

and try again.
0
 

Accepted Solution

by:
acadenilla earned 0 total points
ID: 24147640
Thanks guys for the suggestion

i used the following to get it to work
Response.ClearContent();
Response.ClearHeaders();
Response.AppendHeader("Content-Disposition", string.Format("attachment; filename={0}", file.Name));
Response.AppendHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/pdf";
Response.TransmitFile(file.FullName);
Response.End();

Open in new window

0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question