This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem in displaying pdf files in web browser  RSS feed

 
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: 42972
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!