Hi,
I am having an issue with displaying an image that is uploaded in a mysql database.
The table format is
| id | name | mime | size | data |
| 1 | test | image/jpeg| 74857 | BLOB |
The data has uploaded fine. I then have the following script on my 'displayimage.php?imgid=1' page...
$id = $_GET['imgid'];
$result = mysql_query("SELECT * FROM images WHERE id = '$id'");
while($row = mysql_fetch_array($result))
$size = $row['size'];
$mime = $row['mime'];
$name = $row['name'];
{
header("Content-length: $size");
header("Content-type: $mime");
header("Content-Disposition: attachment; filename=$name");
echo $row['data'];
However everytime i try to open this page, Firefox or Internet Explorer just ask's me to try and download the file as a php file. Any ideas what is going wrong?
Thanks!
Matt