标题:
PHP强制文件下载
[打印本页]
作者:
xiexie
时间:
2008-10-22 22:47
标题:
PHP强制文件下载
filepath='文件路径'; if(strpos($filepath,"http://")===false) { $downaddress="http://".$_SERVER['HTTP_HOST'].$filepath; //header("Location:".$downaddress); header("Content-Disposition: attachment; filename=".$myrow['filename']); readfile($downaddress); } else { header('Location:'.$filepath); } //注意在该处理不能有任何的输出语句
欢迎光临 PHP开发笔记 (http://www.phpvi.com/)
Powered by Discuz! 6.1.0