📄 download.php
字号:
<?php
require 'config.php';
require 'db.php';
$db=new db;
$db->connect($dbhost, $dbuser, $dbpwd, $dbname);
$ref=$_POST['ref'];
$res=$db->query("select count(*) from list where code='".$ref."'");
$count=$db->fetch_row($res);
if(!$count[0])
{echo "no such file";}
else
{
$sql="select file from list where code='".$ref."'";
$res=$db->query($sql);
$tmp=$db->fetch_row($res);
$filename=$uploaddir.$tmp[0];
$realname=substr($tmp[0],0,-5);
$str='Content-Disposition: attachment; filename="'.$realname.'"';
header("Content-type: application/force-download");
header($str);
readfile($filename);
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -