This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Please help with response.getoutputStream " Watch "Please help with response.getoutputStream " New topic
Author

Please help with response.getoutputStream

minhdung tran
Greenhorn

Joined: Dec 19, 2007
Posts: 11
    
    1
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
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

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: http://aspose.com/file-tools
 
subject: Please help with response.getoutputStream
 
Similar Threads
Servlet to send RTF
Download file
Problem displaying pdf
Displaying PDF files on browser
Problem With Download File Servlet