IE8 in windows xp opens .pdf, but not in windows 7

I have a site that lists customer letters, and when a letter's "view" button is clicked it uses JavaScript (window.open(url)) to open a new window to get the .pdf file, which I think is generated by crystal reports.

  • In IE8 on Windows XP it works
  • On Windows 7 it opens a blank page with the correct url, but it doesn't try and open the file
  • In any other browser on either OS it works
  • The machine has the latest Adobe Reader installed

In Win7/IE8 once the blank page is opened, if you then click on the url and hit enter, it will request the file again and correctly open it. I've looked at the requests with fiddler and they're exactly the same.

I'm setting the mime type to "application/pdf" and inline to true in the content-disposition header.

I can kludge it by returning a view that just sets window.location = url, but it feels awful. Is this a known issue? Is there any way to make it work in both IE versions?

Answers


Still no idea why there's the disparity between the two versions, but instead of JavaScript I'm now using target="_blank" on the element and that's done the trick.


Need Your Help

Regex word boundry

java regex

I am splitting a string by word boundary.

get heap corruption when changing member variables order

c++ gcc

i have a quite strange problem. my class has -among others-

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.