【发布时间】:2016-07-21 18:38:09
【问题描述】:
我有一个用 php 编写的脚本,它使用 MIME 类型将 html 表导出到 excel。
自昨天 2016 年 7 月 20 日以来,excel 2010 不再从我的网站打开任何文件,我注意到它没有从任何其他执行相同导出的网站打开
这是一个测试代码
<?php
header('ContentType : application/vnd.ms-excel');
header('Content-Disposition : attachment;filename=test.xls');
header('Pragma : no-cache');
$out = "
<table>
<tr>
<td>something 1</td>
<td>something 2</td>
<td>something 3</td>
<td>something 4</td>
<td>something 5</td>
</tr>
</table>
";
echo $out;
?>
代码仍在运行,但任何 excel 2010 都在打开此文件
谢谢
【问题讨论】:
标签: php excel mime-types