down.php

来自「1.增加了近40项后台核心设置」· PHP 代码 · 共 25 行

PHP
25
字号
<?php
require "./global.php";
if($downid) $query = $db->getone("SELECT tempname,savename,type FROM xydw_up WHERE id='$downid'");
if(!$query) msg('down_no','index.php');
$type == 1 ? $downfile = R_P.$rootindex['updir']."/pic/".$query['savename'] : $downfile = R_P.$rootindex['updir']."/".$query['savename'];
if(file_exists($downfile)){
   $filesize = filesize($downfile);
   $filelast = substr(strrchr($query['savename'],'.'),1);
   if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')!==false && $filelast == 'torrent' ){
	  $attachment='inline';
   } else{
	  $attachment='attachment';
   }
   header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
   header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
   header('Pragma: no-cache');
   header('Content-Encoding: none');
   header('Content-Disposition: '.$attachment.'; filename='.$query['tempname']);
   header('Content-Length: '.$filesize);
   header('Content-type:'.$filelast);
   echo readover($downfile);
} else {
   msg('down_no','index.php');
}
?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?