• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem download files from MySQL to jsp

 
alex bertez
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i run the jsp in eclipce i get the file from the sgbd but when i run it in chrom or firefox i get this page with caracter like this "%PDF-1.4 %���� 6847 0 obj <> endobj xref 6847 32 0000000016 00000 n 0000001630 00000 n 0000001879 00000 n 0000002220 00000 n 0000002858 00000 n 0000003625 00000 n 0000004167 00000 n 0000004308 00000 n..."
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36031
432
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alex,
Welcome to CodeRanch!

Most people would use a Servlet for this rather than a JSP since you aren't creating the content with a template. Regardless, you need to set the content type to PDF so the browser knows this isn't HTML content. You can see examples here. Right now, you are getting a mess of binary, because the browser is trying to display it as text.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!