Размер файла: 694B
<?
require('../include/path.php');
if(isset($_GET['id']) && !preg_match('/[^0-9]/',$_GET['id'])){
if($result=sql_query("SELECT file_name,file_exp FROM `".PRE."dc_files` WHERE file_id=".$_GET['id'])){
if($row=mysql_fetch_row($result)){
if($row[1]=='jar'){
$filepath=$path.'/files/jar/'.$row[0].'.jad';
header('Content-Length: '.filesize($filepath));
header('Content-Type: text/vnd.sun.j2me.app-descriptor');
header('Content-Disposition: attachment; filename='.$row[0].'.jad');
readfile($filepath);
sql_query("UPDATE `".PRE."dc_files` SET file_downloads=file_downloads+1 WHERE file_id=".$_GET['id']);
}
}
}
}
?>