
February 21st, 2002, 06:20 AM
|
|
Java Developer
|
|
Join Date: Nov 2001
Posts: 5
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Hi,
You can store them as blobs (binary large objects) or clobs(character large objects), if your database will support them. Though you can't treat them the same as you would other data that you insert/retrieve from a db, you instead have to get a reference to them from the db and use a (input/ouptut)stream to write/read from them.
Once you've got them you can stream them to the client on the servletOutputStream, and set the contentType to the relevant type (must be done before opening the stream if I remember rightly though).
Is this the kind of answer you were looking for?
This isn't pretty, and if you can avoid it I would. If it is secure you could always use the db to store the file name and path, then just redirect a browser to the specified file. Clobs and Blobs are as far as I'm aware not even stored in the main db, they are more like pointers to files that external to the db
Oscagne
|