: > 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

Reply via email to