IE tries to download PDF rather than display it

F

fb

A page I created includes a piece of javascript, shown at the foot of
this posting, that opens up a new browser and displays a PDF File. The
servlet "previewCompetencyLevel" generates the PDF and sends it with a
content type of "application/pdf".

The code works fine with Firefox.

However, with IE, instead of opening a new browser and displaying the
PDF, it opens up a new browser AND a "File Download" dialog box, which
is not what I want.

Can someone tell me why IE operates differently to FireFox and what I
can do to get the functionality I want with IE?

Thanks,

Frank.

--- code excerpt start ---

<a href="#"
onClick="window.open('/humanresources/previewCompetencyLevel?abilityDegree=3&parentAbilityId=186&abilityLevelId=306',
'previewWindow', 'resizable=yes'); return false;">View</a>

--- code excerpt end ---
 
R

Randy Webb

fb said the following on 9/8/2005 9:34 AM:
A page I created includes a piece of javascript, shown at the foot of
this posting, that opens up a new browser and displays a PDF File. The
servlet "previewCompetencyLevel" generates the PDF and sends it with a
content type of "application/pdf".

The code works fine with Firefox.

It works fine with Firefox for the way you have Firefox setup.
However, with IE, instead of opening a new browser and displaying the
PDF, it opens up a new browser AND a "File Download" dialog box, which
is not what I want.

What about what the user wants? I have my IE explicitly set *not* to
open .pdf files but to download them instead. When I do choose to open
them, they do not open in an IE (nor Firefox) window but rather they
open in Adobe, which is the way *I* want it.
Can someone tell me why IE operates differently to FireFox and what I
can do to get the functionality I want with IE?

IE operates differently from Firefox because they are two different
browsers written by two different sets of people.
 
M

mjj

It's pretty dopey, but al the examples for this are as you have - ie.
header("Content-Disposition: attachment; filename=\"FILENAME\"");
This forces the pop up box to ask you if you want to save or open etc.

....
But to make it work just change it to :
header("Content-Disposition: inline; filename=\"FILENAME\"");



Mark
 

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

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top