header("Content-Type:application/octetstream");
header("Content-Disposition: attachment; filename=a.htm");
header('Pragma: no-cache');
header('Expires: 0');
header("Content-Disposition: attachment; filename=a.htm");
header('Pragma: no-cache');
header('Expires: 0');
提示无法打开internet站点
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=a.htm");
readfile("a.htm");
$file_dir = "http://b22/click/media/";
header("Content-Type:application/octetstream");
header("Content-Disposition: attachment; filename=".$file_dir.$file_name);
header('Pragma: no-cache');
readfile($file_dir.$file_name);思想是这样:把服务器b22的虚拟目录click/media/a.htm下载到本地
上面的实现方法问题在哪里?
能弹出下载框,但按确定下载的时候却提示无法打开internet站点。
大家能帮我解决吗?大家的方法都试过了,似乎不行。
header("Content-Disposition: attachment; filename=a.htm");
header('Pragma: no-cache');
header('Expires: 0');
$file_url="http://b22/click/media/a.htm"
//这里最好用相对定位
$fpopen=fopen($file_url,"rb");
$data =fread($fpopen,filesize($file_url));
echo $data;