Maison >développement back-end >tutoriel php > ie上在excel后内容为空
ie下在excel后内容为空
<br /> $name = '1.xls';<br /> $file = fopen($name, "rb"); // 打开文件<br /> Header('Content-type: application/octet-stream;charset=utf-8');<br /> //Header("Content-type:application/force-download");<br /> Header('Accept-Ranges:bytes');<br /> Header('Accept-Length:' . filesize($name));<br /> Header('Content-Disposition: attachment; filename="' . $filename.'"');<br /> echo fread($file, filesize($name));<br /> fclose($file);<br />
$name = '1.xls';<br /> //$file = fopen($name, "rb"); // 打开文件<br /> Header('Content-type: application/octet-stream;charset=utf-8');<br /> //Header("Content-type:application/force-download");<br /> Header('Accept-Ranges:bytes');<br /> Header('Accept-Length:' . filesize($name));<br /> Header('Content-Disposition: attachment; filename="' . $name.'"');<br /> readfile($name);<br /> //fclose($file);