可以实现的,用header,不过我不记得代码了,回头再给你
解决方案 »
- 求教!php的SoapClient问题,webservice的地址从ip地址改为域名后报错了
- 在这基础上加入分页和添加
- 为什么有些网站在浏览器什么看不到页面的后缀名(如.php,.aspx)
- 请问,这样写对不对?谢谢! foreach($arr3 as $key=>($value1=>$value2)) { }
- 大家推荐一个windows下好用的php编辑器,谢谢![
- Session为什么不能用?
- 关于php.ini里面的设置问题,急等......
- 关于对文件操作的问题!
- PHP是不是没有JSP好,这里的人好少,PHP写的有名的网站也很少!
- 一个数据表中闹鬼的事
- 分页显示问题100分,回复者有分(在线等候)
- phpmyadmin用户管理问题?
// 输入文件标签
Header("Content-type: application/octet-stream");
Header("Accept-Ranges: bytes");
Header("Accept-Length: ".filesize($filename));
Header("Content-Disposition: attachment; filename=$filename");
// 输出文件内容
$fp = fopen($filename, "rb");
echo fread($fp,filesize($filename));
fclose($fp);
exit();
可以试一下以下代码,IE 和NetScape下均可
次数可以用另数一变量保存到据库或文件中
$name=trim(basename($strFullPath));
header("Expires: " . gmdate("D, d M Y H:i:s",time()+24*3600) . " GMT");
header("Cache-Control:");
header("Pragma: cache");
header("Connection: close"); if(strpos(getenv("HTTP_USER_AGENT") , "MSIE")){
header("Content-type: application/download");
header("Content-Disposition: filename=$name");
header("Cache-Control: store, cache, must-revalidate, post-check=0, pre-check=0");
header("Keep-Alive: close");
}
else
{
header("Cache-Control: store, cache, must-revalidate, post-check=0, pre-check=0");
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment;filename=$name");
}
}$fp=fopen($strFullPath,"rb");
fpassthru($fp);
flush();
exit;
?>