<?php
include_once('db.inc.php');

$s_dir = '/var/www/vhosts/konyvel.net/httpdocs/admin/upload/';


$mydb = new db();
$stmt="SELECT * FROM kk_upload WHERE id=$id AND letoltheto='1'";

$result=$mydb->query($stmt);
$row = mysql_fetch_object($result);

$real_name = $row->real_name;
$file_name = $row->file_name;
$file_type = $row->file_type;

$output = $s_dir.$file_name;
$fp = fopen($output, 'rb');


header('Pragma: ');
header('Cache-Control: cache');
header("Cache-control: private");
header("Content-Length: ".filesize($output)); 
header("Content-type: ".$file_type);
header("Content-Disposition: filename=\"".trim($real_name)."\""); 

fpassthru($fp);
exit();



?>