Jump to content

image stored in a mysql blob field - save to directory


webgodjj

Recommended Posts

Hi, I have been scouring forums to find out how to extract images from a blob field in a mysql database to a file. Then take this image and store the path and it's image name to a new table.

Something like this:

SELECT * FROM products;
foreach image:
generate new id - $id = uniqid(rand(), true);
save image -> images/products/$id.jpg
insert into products_2 -> product name ... , ... , ... , imageid, ....

I think that I need to use imagecreatefromstring() function, however, how to save it to the directory is beyond me...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.