Location: PHPKode > projects > L-Forum > l-forum/attachment.php
<?

include "config.php";
include "lib/init.inc";

if(empty($i))
   error_f($lang['no_mess_id']);

$q = new Query("select attach from articles where id = $i");

if($q->nr() != 1)
   error_f($lang['bad_res']);

$r = $q->row();
if(empty($r['attach']))
   error_f($lang['no_mess_id']);

header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=".$r['attach']);
readfile("upload/".$i)
?>
Return current item: L-Forum