Hi.
I think that the problem is the header. Please see:
http://www.phpbuilder.com/mail/php-general/2000081/1036.php
bye
Pablo Garcia wrote:
I thing the best solution is to save the file on the server's filesystem and only to save the url in the db.
There are many browsers incompatibilities. Following headers are working on IE 5.0 but not on 5.5 or netscape 6.0:
<?php
Read a image file from tb_binary_data and show it
MYSQL_CONNECT("localhost", "u","p");
mysql_select_db("db");
$query = "SELECT * FROM tb_binary_data WHERE binary_data_id=$id";
$result = mysql_query($query);
$file=mysql_fetch_array($result);
$data = $file["bin_data"];
$name = $file["filename"];
$size = $file["filesize"];
$type = $file["filetype"];
header("Content-type:$type");
header("Content-length:$size");
header("Content-Disposition: attachment; filename=\"$name\"");
header("Content-Description😛HP Generated Data");
echo $data;
?>