This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Displaying pdfs from MS SQL Server" Watch "Displaying pdfs from MS SQL Server" New topic
Author

Displaying pdfs from MS SQL Server

Srinivas
Greenhorn

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
srinivas


Srinivas
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");
 
 
subject: Displaying pdfs from MS SQL Server