I would like to download images stored as Blob in mysql. I do not want to just display the image on a web page. I want to want to download the image file onto my computer. How do I do this? Below is the script for displaying the image on a web page. How do I modify this?
<?php
$link=mysql_connect("localhost","root","");
if(!$link)
{
die("could not connect:".mysql_error());
}
mysql_select_db("media",$link);
$que="select imageBlob from images where imageId=10"; //imageBlob- name of the blob data type field in mysql.
$ret=mysql_query($que)or die("Invalid query: " . mysql_error());
header("Content-type: image/jpeg");
echo mysql_result($ret, 0);
mysql_close($link);
?>