php 下载excel后乱码,求大侠解决,
源码如下:在服务器上是好的,但是下载后就不行啦,$file=fopen($file_dir."/".$file_name,"r");//打开文件header('Conte...
源码如下:在服务器上是好的,但是下载后就不行啦,
$file = fopen($file_dir."/".$file_name,"r"); // 打开文件
header('Content-Encoding: none');
header("Content-type: application/octet-stream");
header("Accept-Ranges: bytes");
header("Accept-Length: ".filesize($file_dir."/".$file_name));
header( 'Content-Transfer-Encoding: binary' );
header("Content-Disposition: attachment; filename=" .$file_name); //以真实文件名提供给浏览器下载
header('Pragma: no-cache');
header('Expires: 0');
echo fread($file,filesize($file_dir."/".$file_name));
fclose($file); 展开
$file = fopen($file_dir."/".$file_name,"r"); // 打开文件
header('Content-Encoding: none');
header("Content-type: application/octet-stream");
header("Accept-Ranges: bytes");
header("Accept-Length: ".filesize($file_dir."/".$file_name));
header( 'Content-Transfer-Encoding: binary' );
header("Content-Disposition: attachment; filename=" .$file_name); //以真实文件名提供给浏览器下载
header('Pragma: no-cache');
header('Expires: 0');
echo fread($file,filesize($file_dir."/".$file_name));
fclose($file); 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询