$filename為路徑名稱+檔案名稱。
ex: ./xml/POI.xml
ex: ./pic/xxx.jpg
------------------------------------------
$filename = ./xml/POI.xml;
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=\"".basename($filename)."\";" );
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($filename));
readfile("$filename");
exit();
0 留言