标签为 "msie" 的存档

php header IE6文件下载失败问题

使用php header实现文件下载时,在IE6下总是提示不能下载,谷歌浏览器正常, 因此应该是IE的问题,IE下有个bug,微软官网有说明。错误消息:“Internet Explorer cannot download a file”(Internet Explorer 不能下载文件),有个办法可以很好的解决,看代码好了:

  if(strstr($_SERVER["HTTP_USER_AGENT"],"MSIE")==false) {
	header("Cache-Control: no-cache");
	header("Pragma: no-cache");
}   
header('Cache-Control: public, must-revalidate, max-age=0');
header('Accept-Ranges: bytes');
header("Content-Type: application/force-download");  
header("Content-Type: application/download");  
header("Content-Type: application/octet-stream");  
if(!empty($content_type)){
	header("Content-Type: ".$content_type);  
}   
header("Content-Transfer-Encoding: binary");  
header('Content-Disposition:attachment;filename="'.rawurlencode($filename).'"');