We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The solution is here:
private function set_headers() { $ua = $_SERVER["HTTP_USER_AGENT"]; $filename = $this->filename . ".xls"; $encoded_filename = urlencode($filename); $encoded_filename = str_replace("+", "%20", $encoded_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/octet-stream"); //header("Content-Type: application/vnd.ms-excel;charset=UTF-8"); header("Content-Type: application/download");; if (preg_match("/MSIE/", $ua)) { header('Content-Disposition: attachment; filename="' . $encoded_filename . '"'); } else if (preg_match("/Firefox/", $ua)) { header('Content-Disposition: attachment; filename*="utf8\'\'' . $filename . '"'); } else { header('Content-Disposition: attachment; filename="' . $filename . '"'); } header("Content-Transfer-Encoding: binary "); }
此代码用于解决保存文件名为中文的时候在IE下出现乱码的问题。
The text was updated successfully, but these errors were encountered:
http://www.laruence.com/2012/05/02/2613.html
Sorry, something went wrong.
JOakley77
No branches or pull requests
The solution is here:
此代码用于解决保存文件名为中文的时候在IE下出现乱码的问题。
The text was updated successfully, but these errors were encountered: