Code: Select all
$download = "select data, mimeType, filename from minutes where minutesId='".$id."' and length(trim(filename))>0 and data is not null";
$downloadResult = @mysql_query($download);
if($row = @mysql_fetch_array($downloadResult)){
$data = @mysql_result($downloadResult, 0, "data");
$mimeType = @mysql_result($downloadResult, 0, "mimeType");
$fileName = $_GET['filename'];
header("Content-type: $mimeType");
header("Content-Disposition: attachment; filename=$fileName");
header("Content-type: application/force-download");
echo $data;
exit;
Any ideas?