Solved

Error opening pdf file using ie6 but it works in ie7

Posted on 2009-04-14
4
507 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
LINQ - C# to VB convertion 12 45
I need help embedding Base64 Images using VB.Net - When image is a .jpg 2 39
ADO.NET ENTITY DATA MODEL 3 30
Split in Javascript 5 30
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

947 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now