I know im close but the file will not download. It appears to be saving to the database OK. All the relevant variables are ok ($data, $mime and $filename)
The error received can be viewed here
I'm trying to link to this page to display a file from the database but the problem appears to be with the filename. The file name is coming from the database OK but the browser is trying to download file.php not orderform.doc
It works fine in Mozilla but IE 5 is not playing along. Any idea how to get around this problem??
<?
session_start();
include "db_connect.php";
$query = mysql_query("select * from documents where template_id=$template_id");
$data = mysql_result($query,0,"doc_data");
$mime = mysql_result($query,0,"mime_type");
$filename = mysql_result($query,0,"doc_name");
header("Content-Disposition: attachment; filename=$filename");
header("Content-type: $mime");
?>