Response.ContentType application / vnd.ms-excel xls停止工作 [英] Response.ContentType application/vnd.ms-excel xls stopped working

查看:1051
本文介绍了Response.ContentType application / vnd.ms-excel xls停止工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这个问题上做了一些非常深入的搜索,没有运气。看来,过去几天来,HTML中的XLS输出已经停止了我支持的许多遗留(读取:经典ASP)系统的工作。我已经在多台服务器上复制了这个,Office 2010通过Office 2016的多个独立的源代码。我看过我能想到的一切,没有成功,所以我很想知道是否有可能会忽略的东西。我开始认为这可能是一个糟糕的Office更新,这是罪魁祸首。

I've done some pretty deep searching on this issue with no luck. It seems that in the past couple of days the output to XLS from HTML has stopped working on many legacy (read: Classic ASP) systems I support. I've been able reproduce this on multiple servers, multiple independent source code from Office 2010 through Office 2016. I've looked at everything I can think of without success so I'm curious to know if there is something I might be overlooking. I'm starting to think this may be a bad Office update that is the culprit.

多少年来有效和已经工作的示例:

Sample of what works and has been working for many years:

<%

Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "attachment;filename=TestExcel.xls"

%>

<html>
    <body>
        <table>
            <thead>
                <tr>
                    <th>column 1 header</th>
                    <th>column 2 header</th>
                </tr>
            </thead>

            <tbody>
                <tr>
                    <td>column 1 value</td>
                    <td>column 2 value</td>
                </tr>
            </tbody>

            <tfoot>
                <tr>
                    <td>Footer 1</td>
                    <td>Footer 2</td>

                </tr>

            </tfoot>
        </table>
    </body>
</html>

有趣的是,XLS文件实际上是创建的,但是当打开Excel时打开Excel文件存在。

What is curious is that the XLS file is in fact created but when it is opened Excel opens but not file is present.

更好奇的是,当您使用某些文本编辑器(例如记事本)打开XLS文件时,只需使用File-> Save即可打开,无问题

Even more curious is that when you open the XLS file with some text editor (notepad for example) and just File->Save As it opens without issue.

推荐答案

该问题与2016年7月12日发布的Microsoft安全更新KB3115262相关。安全更新信息可以可在Microsoft安全公告MS16-088中找到 - 严重。

The issue is related to Microsoft Security Update KB3115262 for Excel that was released July 12, 2016. The security update information can be found in Microsoft Security Bulletin MS16-088 - Critical.

我找到了三个解决方法(按照我的优先顺序):

I've found three workarounds (in my order of preference):


  • 而不是单击打开,保存文件然后打开它

  • 在Excel信任中心>信任中心设置>受保护视图中,取消选中前两个选项。这是可能不安全的。

  • 卸载安全更新。

以下是有关问题进一步阅读。
https://social.technet.microsoft.com/Forums/en-US/d2d84793-9920-45e3-baef-5027a4ac1ae0/kb3170008-for-office-2016-breaks-功能-ms16088?forum = officeitpro

Below are several links regarding the issue for further perusal. https://social.technet.microsoft.com/Forums/en-US/d2d84793-9920-45e3-baef-5027a4ac1ae0/kb3170008-for-office-2016-breaks-functionality-ms16088?forum=officeitpro

https://technet.microsoft.com/library/security/MS16-088

https://salesforce.stackexchange.com/questions/131404/end-user- can not-open-a-xls-report-exports-from-salesforce

将HTML表导出到Excel-不在Office 2010中打开

这篇关于Response.ContentType application / vnd.ms-excel xls停止工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆