Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Servlets and the fly likes Please help with response.getoutputStream Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Please help with response.getoutputStream " Watch "Please help with response.getoutputStream " New topic

Please help with response.getoutputStream

minhdung tran

Joined: Dec 19, 2007
Posts: 13
Good afternoon,
Hope you all have a pleasant afternoon.

For my school project, i would like to return a PDF file from my file system using a servlet's response.getOutputStream method.
It seems to be very straight forward operation, but somehow it does not work. It gave me an unclear message such as "There is a problem with adobe acrobat reader. Please exit and try again (1014:1014) which i don't understand. I have a good copy of acrobat reader and i don't know why it said that i have a problem with it?

Anyway, here is my code and if you see something wrong , please let me know. I am very thankful of all of your help.

Paul Clapham

Joined: Oct 14, 2005
Posts: 19739

In your Content-Disposition header, you should provide a proper filename for the download. A path isn't a filename. I suggest simply "hello.pdf".
I agree. Here's the link:
subject: Please help with response.getoutputStream
It's not a secret anymore!