I received a phone call from a friend of mine who had some
questions about storing image files as blobs in MySQL. He wanted
to design a web site that would allow someone to upload an image,
and then that image would be stored in the MySQL database for
viewing later. He stated that he was going to be storing
thousands of images. I mentioned that it might be better to store
the images on the file system, and then to just store the
location of the image in the database. But, he still wanted to
know how to do it and would decide which solution he would
incorporate later.
I already had a Perl script that allowed me to upload files to a
web site, as I would give out this URL to people that wanted to
send me large files. And, I know that you can store images (and
other files) in MySQL as a blob, but I wasn’t sure how to display
the blob as an image in HTML (once I had retrieved it from the
MySQL database). A search on Google provide bits and …
[Read more]