I see no point in such design... That will be replicating the same data (the images) in two separate systems (your database and your file system) and keeping the two synchronized. Too much overhead for a simple problem.

Why don't you just make your servlet simply output the images (read from the database based on the user's id) in the response (setting first the content-type to "image/jpg" or something appropriate). Then, in your html, you can simply put: <image src="<http://yourserver/pathtoyourservlet>"/>

Regarding your java.io.File problem: I used it many times before to create files and it never added anything to the filename. Maybe you can send a snippet of the code where you create the filename... Is it something like '@' followed by a number the weird stuff what you get?

Radu

Mark Lowe wrote:

Not really entirely a struts question but here seems as gooder place as any.

To have the benefits of storing images in the database without having
to write a byte array to an output stream, I figured have a servlet
that lists all the blobs from a data base and then create files based
on those at start up. And when new images are added perhaps generate
them then. Likewise when deleting images from the database, then
delete those files.

The only problem I'm having is that the files I create using the
java.io.File appends some weird shite to the file name when i need
these to match exactly the uids and such like I'm trying to call them.

Anyone had to deal with this before?

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to