• 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: 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!