View file ViPTurbo 3.0/files/download.php

File size: 702B
<?
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)){

   include($path.'/manage/ctype.php');
       
   header('Content-Length: '.filesize($path.'/files/'.$row[1].'/'.$row[0].'.'.$row[1]));
   header('Content-Type: '.$ctype[$row[1]]);
   header('Content-Disposition: attachment; filename='.$row[0].'.'.$row[1]);
   readfile($path.'/files/'.$row[1].'/'.$row[0].'.'.$row[1]);
   
   sql_query("UPDATE `".PRE."dc_files` SET file_downloads=file_downloads+1 WHERE file_id=".$_GET['id']);
  }
 }
}

?>