File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Download file from database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Download file from database" Watch "Download file from database" New topic

Download file from database

Jacek Marciniak

Joined: Dec 13, 2011
Posts: 3

I have a little problem with downloading file which is stored in database.
I use this code to get file from db, but I receive only page with weired sings.

I can't save it as a file on my computer. File types can be different, ie. .pdf or .jpg.
Server JBoss 5, Seam 2.2.0 GA, JSF 1.2

Thanks in advance for your help
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

JSF is designed to output HTML web pages, not arbitrary text or binary files. Use a servlet for that part of the webapp.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Download file from database
It's not a secret anymore!