时间:2021-07-01 10:21:17 帮助过:143人阅读
$user_agent = $_SERVER['Http_User_agent'];
$encode_filename = rawurlencode($filename);
if(preg_match("/MSIE/", $user_agent)){
header('content-disposition:attachment; filename="'.$encode_filename.'"');
}else if(preg_match("/Firefox/", $user_agent)){
header("content-disposition:attachment; filename*=\"utf8''".$filename.'"');
}else{
header('content-disposition:attachment; filename="'.$filename.'"');
}