File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Open pdf from Explorer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Open pdf from Explorer" Watch "Open pdf from Explorer" New topic

Open pdf from Explorer

Alan Hermin
Ranch Hand

Joined: Feb 16, 2006
Posts: 290
hi all..i do'nt know if this is correct post here or at JSP forum
i want to open pdf file in the Explorer,,,i mean when clicking on some button , i want to open the file at Explorer, not to download it then open it from the downloaded pdf..

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63533

Create a link to it and make sure that your browser is properly configured.

[Asking smart questions] [About Bear] [Books by Bear]
Senthil S Kumar

Joined: Aug 13, 2006
Posts: 10
You can use the "Content-disposition" property to open the file inline or as an attachment.

Also, make sure you are setting the content type to "application/pdf".

Refer here for more details.
[ August 13, 2006: Message edited by: Senthil S Kumar ]
Alan Hermin
Ranch Hand

Joined: Feb 16, 2006
Posts: 290
Thnx all ...
all thing go fine..

Rusty Smythe
Ranch Hand

Joined: Aug 09, 2006
Posts: 93

Be aware that any commands sent to a browser are only suggestions.

Someone could configure their browser to always download a PDF, and there is nothing you can do about that.
I agree. Here's the link:
subject: Open pdf from Explorer
jQuery in Action, 3rd edition