经测试代码如下:
/**
* 不透露实际地址的文件下载
*
* @param
* @arrange (512.笔记) jb51.cc
**/
function download_document($filename,$path = "",$mimetype = "application/octet-stream")
{
header("Cache-Control: must-revalidate,post-check=0,pre-check=0");
header("Content-Disposition: attachment; filename = $filename");
header("Content-Length: " . filesize($pathto . $filename));
header("Content-Type: $mimetype");
echo file_get_contents($pathto . $filename);
}
/*** 代码来自编程之家 jb51.cc(jb51.cc) ***/
上面只是浅析介绍了PHP不透露实际地址的文件下载 的内容,仅供大家参考。 原文链接:https://www.f2er.com/php/528879.html