This week's book giveaway is in the HTML/CSS/JavaScript forum.
We're giving away four copies of Practical SVG and have Chris Coyier on-line!
See this thread for details.
Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem in displaying pdf files in web browser

 
geetla srujana
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
we are developing an web application in which we have to display different types of files to the end user.We are storeing files as blob objects in database.We able to display text,html,java files but we are facing problem in displaying pdf files .File content is not displaying in PDF format.
we are using
response.setContentType("application/pdf");
to open pdf file .but it is not opening properly...
please help me out.
Thanks in advance
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSPs are not meant to stream binary data (like PDFs). You need to use a servlet instead.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may find this article useful then: http://balusc.blogspot.com/2007/07/fileservlet.html
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!