Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Servlet Interest »

Re: problem of open a pdf file on client browser through servlet

Fabro, Loic

2004-01-29


RE: problem of open a pdf file on client browser through servlet

Or replace it by

response.setHeader("Content-Disposition","inline; filename=arswww.pdf");

If you do "attachment", IE (other browsers?) give you the option to open the file/save it outside of the browser.

2 cents,
Loic.
-----Original Message-----
From: Mathias Höggren [mailto:mathias@NYAMEDIER.SE]
Sent: Thursday, January 29, 2004 5:36 AM
To: SERVLET-INTEREST@JAVA.SUN.COM
Subject: SV: problem of open a pdf file on client browser through
servlet


Hi!

Remove the line:
response.setHeader("Content-Disposition","attachment; filename=arswww.pdf");

And it will work just fine.

Brgds
Mathias

-----Ursprungligt meddelande-----
Från: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:SERVLET-INTEREST@JAVA.SUN.COM]För KL OOI
Skickat: den 29 januari 2004 11:22
Till: SERVLET-INTEREST@JAVA.SUN.COM
Ämne: problem of open a pdf file on client browser through servlet


Hi all,

I have a servlet which send a pdf file to client browser.
I have the below code inside my servlet.
   response.setContentType("Content-Type: application/pdf");
   response.setHeader("Content-Disposition","attachment;
filename=arswww.pdf");

But this will pop up a dialog whether want to open, save or cancel the file.

How can I make it open the pdf in the client browser without pop up the
dialog?

Thanks.


Best regards,
KL OOI

___________________________________________________________________________ To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

©2008 junlu.com - Jax Systems, LLC, U.S.A.