Pedro Santos wrote:

>     I'm trying to build a database where users can send a description and an
> image to the database. Whenever I access the database trought my a perl
> script my browser should show me the description and the image.
>     For the description I can do this without any problems but I don't know
> what to do with the images because I need an HTML tag  like this <img
> src="nameoftheimage.gif"> but that's a name not the real image, so what
> should I do? Just place the image in a directory(but there is allways the
> problem that 2 diferent users place an image with the same name) and a
> reference to where it is in the database, or do anyone has any idea how this
> should work.


assign each uploaded image a new filename.  if you're using apache, 
something like $ENV{UNIQUE_ID} will probably be good enough.  then store 
just the filename in the db.

you can also store the image directly in the db if you set up the field 
  as type 'blob'.

you can check to see if the filename already exists by doing something 
like this:

print "$filename already exists." if -e $filename;


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

Reply via email to