if( stripos($_SERVER['HTTP_USER_AGENT'], 'MSIE')!==false ) $filename = urlencode( $filename ); // 输入文件标签 Header("Content-Type: application/vnd.android.package-archive"); Header("Accept-Ranges: bytes"); Header("Accept-Length: ".filesize($file_path)); Header("Content-Disposition: attachment; filename=" . $filename ); // 输出文件内容 echo fread($file,filesize($file_path)); fclose($file);
如果当前浏览器是ie, 需要对包含中文的文件名进行urlencode编码
本文来自博客园,作者:三哥-Noble,转载请注明原文链接:https://www.cnblogs.com/Noble-zeng/p/12837495.html