PDA

View Full Version : Blob type : How to ...



mark1
04-30-2006, 10:25 PM
This is my problem:
I have several GIFs stored in a mysql table as Longblob type.

I'd like to "convert" this binary content to "regular" GIF files on my Hard Drive

What's the esiest way to do it?

ps. I have the script to display the images with PHP, that doesn't solve my prob.
I need to store the imgs and upload them to a separate folder on my server.

Thanks for helping the n00b :rolleyes:

Kings
05-01-2006, 01:14 AM
Write a PHP script that will retrieve all the GIF images from the database (using the standard DB functions, like mysql_connect and mysql_query), then write each GIF to the HD (using the standard file functions, like fopen and fwrite).

Let me know if you need a simple example

mark1
05-01-2006, 06:48 AM
Thanks Dennis, mission accomplished ;)