时间:2021-07-01 10:21:17 帮助过:25人阅读
$file_name=$_REQUEST['name'];分享到:
$file_name=iconv("utf-8","gb2312",$file_name);
$file_dir="./download/";
if(!file_exists($file_dir.$file_name))
{
echo "文件找不到!";
exit;
}
else
{
header("Content-Type:text/plain");
header("Accept-Ranges:bytes");
header("Content-Disposition:attachment;filename=".$file_name);
$file=fopen($file_dir.$file_name,"r");
echo fread($file,filesize($file_dir.$file_name));
fclose($file);
$num=file_get_contents("./num.dat");
$num=(int)($num)+1;
file_put_contents("./num.dat",$num);
exit;
}
?>