This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Servlets and the fly likes PDF Download Servlet Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "PDF Download Servlet Problem" Watch "PDF Download Servlet Problem" New topic
Author

PDF Download Servlet Problem

Jaz Chana
Ranch Hand

Joined: Feb 19, 2008
Posts: 34
Hi guys,

I'm having issues creating a file download servlet to download pdf files. I can successfully download text files using this code. For some reason however I cannot download a pdf using the same code. On execution, the browser will present me with a dialogue box asking me to open, save or cancel. If i open or save and open later I get an error message saying that the pdf file is corrupt or damaged and won't open properly. I have tried opening the original pdf on the server and there are no problems there. I have absolutely no idea why this is happening. Can someone point me in the right direction please.



Thank You
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39578
    
  27
Start by reading ReadDoesntDoWhatYouThinkItDoes.


Ping & DNS - updated with new look and Ping home screen widget
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: PDF Download Servlet Problem
 
Similar Threads
Unable to open PDF file from servlet.
Delete file when the file downloaded.
How to implement file downloading functionality ?
How to display pdf file in broswer
making a download servlet to service download managers