导出到Excel不工作在IE浏览器下的SSL(HTTPS) [英] Export to Excel doesnt work on IE under SSL (https)

查看:1104
本文介绍了导出到Excel不工作在IE浏览器下的SSL(HTTPS)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在试图解决一些在一个安全的网站(HTTPS),这是一种导出到Excel按钮,生成CSV文件。

它适用于火狐,Chrome,等...但无法在Internet Explorer。

我已经改变了标题消除了无缓存 并且还编辑了IIS HTTP标头配置设置的第1天的有效期。

我不知道什么可以怎么回事,如何解决这个问题。

你们是否对如何解决这一问题的东西什么想法?我已经看了这么多的帖子,他们都在说同样的事情......缓存。

谢谢

更新1:

对于我收到错误,我收到一个IE警告说:Internet Explorer无法从web.address.com下载filename.aspx 互联网浏览器无法打开该Internet站点。该请求的站点是不可用或无法找到。请稍后再试。

正如我所说的,这是可行的SSL(HTTPS),但其导出到Excel按钮,断裂处HTTPS。

更新2:

我用这些标题:

  Response.ClearContent();
                Response.Clear();
                将Response.Buffer =真;
                Response.AddHeader(内容处置,附件;文件名=+ name.Trim()+的.csv);
                Response.AddHeader(缓存控制,无缓存);
                Response.AddHeader(杂,大众);
                Response.AddHeader(内容传输编码,二进制);
                Response.AddHeader(内容长度,2026);

                Response.Charset的=;
                //Response.ContentType =应用程序/ vnd.ms-EXCEL;
                Response.ContentType =文/ CSV;
 

解决方案

这个问题是因为,IE9之前,IE浏览器下载不使用缓存控制头(当工作在SSL的 http://support.microsoft.com/kb/323308 )。

只是删除​​: Response.AddHeader(缓存控制,无缓存);

这工作在HTTPS的IE 6,7和放大器; 8.

I've been trying to fix something on a secure website (https) which is an Export to Excel button that generates a CSV file.

It works on Firefox, Chrome , etc... but not in Internet Explorer.

I have changed the headers eliminating the no-cache and also edited the IIS http header configuration setting an expiration date of 1 day.

I have no idea of what can be going on and how to solve it.

Do you guys have any idea of how to fix this stuff ? I've read so many posts and they're all saying the same thing... caching.

Thanks,

UPDATE 1 :

regarding the error I receive, I receive an IE Alert saying "Internet explorer cannot download filename.aspx from web.address.com Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.

As I said, it all works out of SSL (https), but the export to excel button, breaks in https.

UPDATE 2:

I'm using these headers:

Response.ClearContent();
                Response.Clear();
                Response.Buffer = true;
                Response.AddHeader("content-disposition", "attachment; filename=" + name.Trim() + ".csv");
                Response.AddHeader("Cache-Control", "no-cache");
                Response.AddHeader("Pragma", "public");
                Response.AddHeader("Content-Transfer-Encoding", "binary");
                Response.AddHeader("Content-Length", "2026");

                Response.Charset = "";
                //Response.ContentType = "application/vnd.ms-excel";
                Response.ContentType = "text/csv";

解决方案

The issue is because, before IE9, Internet Explorer downloads do not work over SSL when using cache control headers (http://support.microsoft.com/kb/323308).

Just remove: Response.AddHeader("Cache-Control", "no-cache");

This works in https for IE 6,7 & 8.

这篇关于导出到Excel不工作在IE浏览器下的SSL(HTTPS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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