RE: Getting Images in and out of a Blob

2003-01-31 Thread Hoffman, Geoffrey
You might find this helpful - I did.

http://www.phpbuilder.com/columns/florian19991014.php3

> 
> > Has anyone done any work with getting images into and out of a MYSQL
> > database?  I have used mysql for some time, but never 
> stored an image
> in a
> > blob field.  


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Getting Images in and out of a Blob

2003-01-31 Thread Sherzod Ruzmetov
: > Has anyone done any work with getting images into and out of a MYSQL
: > database?  I have used mysql for some time, but never
: stored an image
: in a
: > blob field.  I am curious on how to insert the image from a web form
: upload,
: > and how to display the picture on another HTML page.
:
: You might want to start here:
: http://www.mysql.com/doc/en/String_functions.html. Look for LOAD_FILE.

If you're writing a web application which takes the file from the file
field,
then it's a lot easier to read the file into memory and back into the table
with
an INSERT clause.

As to LOAD_FILE(), you will have to store the file in a temporary location
before
being able to use LOAD_FILE().

To serve images straight off the database, simply read the files into memory
using
a SELECT query, set the content-type header in your application to the
mime-type of
the image, say "image/png", and write it to the stdout.

Voila!


Sherzod






-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Getting Images in and out of a Blob

2003-01-31 Thread Paul DuBois
At 1:26 -0700 1/30/03, Mike Walth wrote:

Has anyone done any work with getting images into and out of a MYSQL
database?  I have used mysql for some time, but never stored an image in a
blob field.  I am curious on how to insert the image from a web form upload,
and how to display the picture on another HTML page.  Preferred web
scripting is ColdFusion, but PHP/PERL would be helpful too.  Thank you for
your help.


For Perl code, go to:

http://www.kitebird.com/mysql-perl/

and download the webdb distribution.  Look in the image directory.

For PHP (and Perl and Python) code, go to:

http://www.kitebird.com/mysql-cookbook/

and download the recipes distribution.  Look in the apache/images directory.


Mike Walth
CinoFusion



-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Getting Images in and out of a Blob

2003-01-30 Thread Stefan Hinz, iConnect \(Berlin\)
Mike,

> Has anyone done any work with getting images into and out of a MYSQL
> database?  I have used mysql for some time, but never stored an image
in a
> blob field.  I am curious on how to insert the image from a web form
upload,
> and how to display the picture on another HTML page.

You might want to start here:
http://www.mysql.com/doc/en/String_functions.html. Look for LOAD_FILE.

Regards,
--
  Stefan Hinz <[EMAIL PROTECTED]>
  Geschäftsführer / CEO iConnect GmbH 
  Heesestr. 6, 12169 Berlin (Germany)
  Tel: +49 30 7970948-0  Fax: +49 30 7970948-3

- Original Message -
From: "Mike Walth" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 30, 2003 9:26 AM
Subject: Getting Images in and out of a Blob


> Has anyone done any work with getting images into and out of a MYSQL
> database?  I have used mysql for some time, but never stored an image
in a
> blob field.  I am curious on how to insert the image from a web form
upload,
> and how to display the picture on another HTML page.  Preferred web
> scripting is ColdFusion, but PHP/PERL would be helpful too.  Thank you
for
> your help.
>
> Mike Walth
> CinoFusion
>
>
>
>
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Getting Images in and out of a Blob

2003-01-30 Thread Sherzod Ruzmetov
:Has anyone done any work with getting images into and out of a MYSQL
:database?  I have used mysql for some time, but never stored
:an image in a
:blob field.  I am curious on how to insert the image from a
:web form upload,
:and how to display the picture on another HTML page.  Preferred web
:scripting is ColdFusion, but PHP/PERL would be helpful too.
:Thank you for
:your help.

http://gallery.handalak.com/cgi-bin/gallery/1004

The above is my web gallery. That's how it works. I have a control panel
from
where upload images, and they are stored in mysql tables. Then
programmaticly
they are retrieved. If you look at the source of images tags, you may have
an idea how it's done.

Sherzod

P.S. It's done in Perl



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php