<?php
/**
* 隐藏文件的真实下载地址
* Edit www.jb200.com
*/
$file_name = "info_check.exe";
$file_dir = "/www/files/";
//检查文件是否存在
if(!
file_exists($file_dir . $file_name)) exit('文件找不到');
else
{
$file = fopen($file_dir . $file_name,"r"); // 打开文件
// 输入文件标签
Header("Content-type: application/octet-stream");
Header("Accept-Ranges: bytes");
Header("Accept-Length: ".filesize($file_dir . $file_name));
Header("Content-Disposition: attachment; filename=" . $file_name);
// 输出文件内容
echo fread($file,filesize($file_dir . $file_name));
fclose($file);
exit;
}
?>
<?php
/**
* http ftp
文件下载地址隐藏
* Edit www.jb200.com
*/
$file_name = "info_check.exe";
$file_dir = "http://www.jb200.com/";
$file = @ fopen($file_dir . $file_name,"r");
if (!$file) exit('文件找不到');
else {
Header("Content-type: application/octet-stream");
Header("Content-Disposition: attachment; filename=" . $file_name);
while (!feof ($file)) {
echo fread($file,50000);
}
fclose ($file);
}
?>