I am trying to copy images from a Mysql database that someone else has used to store images as binary data into a simple directory so I can replace the binary data with just a path to the newly copied image but I have no exp with storing binary data in a db and I am having troubles.
It will show the image but won't copy it to a new dir. Heres what I'm playing around with.
I would appreciate some code to get this done so I can get on with things.
$sql=mysql_query("SELECT * FROM media,mimetype WHERE media.mimeTypeID = mimetype.mimeTypeID LIMIT 1");
while($row=mysql_fetch_array($sql)) {
header("Content-type: image/gif");
echo $row[bitStream];
//copy($row[bitStream],"../files/$row[mediaID].$row[mimeExt]");
}
The above code shows the gif nicely but I can't figure out how to copy it over??
Comments welcome.
Scottd