Re: [ot] Naming generated files

2004-11-25 Thread Mark Lowe
Its okay i fixed the problem. I was being a dick with the .java.io.File api. 

The design means you can have the maintaince advantages of having
product images and such like without a heavy difficult to cache query
on the database. The hit of requesting blobs and such like will only
happen during startup and when now images are uploaded by admins.

Cross firing to /servlet/image is okay infact i've that in the doGet
to provide a preview mode for admins. I've been doing this for ages
but i want to improve in its now. But I don't want a list of pages
hitting the db on every go, while i don't want to desprate image
folder for the system.

Its not replicating data, its just like a human read able cache.
imageBean.getPath() will return the same as the generated path.

Mark


On Thu, 25 Nov 2004 10:59:08 +0200, Radu Badita <[EMAIL PROTECTED]> wrote:
> 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:  src=""/>
> 
> 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]
> 
>

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



Re: [ot] Naming generated files

2004-11-25 Thread Radu Badita
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: 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]


[ot] Naming generated files

2004-11-24 Thread Mark Lowe
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]