解决方案一(我的页面是utf-8编码):
代码如下 | 复制代码 |
$filename = "中文.txt"; |
解决方法二
将文件名先urlencode一下再放入header,如下。
代码如下:
代码如下 | 复制代码 |
$file_name = urlencode($_REQUEST['filename']); header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Type: application/force-download"); header('Content-Type: application/vnd.ms-excel; charset=utf-8'); header("Content-Transfer-Encoding: binary"); header('Content-Disposition: attachment; filename='.$file_name); echo stripslashes($_REQUEST['content']); ?> |