File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Displaying pdfs from MS SQL Server 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 » JSP
Bookmark "Displaying pdfs from MS SQL Server" Watch "Displaying pdfs from MS SQL Server" New topic

Displaying pdfs from MS SQL Server


Joined: Feb 01, 2002
Posts: 9
I want to display pdfs stored as an image datatype in MS Sql server on a webpage. I am doing this to hide the location of the pdf. Is there a way to do this.
thanks in advance

Joe Pardi
Ranch Hand

Joined: Oct 03, 2001
Posts: 47
You need to open the response output stream and write the bytes to it. Also, make sure to set the content type ("application/pdf"), the content length, and also the content disposition.
response.addHeader("Content-Disposition", ";filename=mypdf.pdf");
Consider Paul's rocket mass heater.
subject: Displaying pdfs from MS SQL Server
Similar Threads
Application Hang when delete() method execute
Bulk data through JDBC
Best JDBC drivers?
Scrollable ResultSet
Urgent : JDBC Driver for MS SQL Server 7