0

we are using window.open('https://cerrtificate-name/csv/394099.aspx?mode=-1') to download a csv file from server. It was working good when I use http but failed to work on in the https certificate enabled server.

It was given "page can't be displayed issue".

In the below lines are used in 394099.aspx to transmit the csv content

String contenttype  = "application/octet-stream";
string strSourceFilepath = "d:\\myfile.csv";
Response.AppendHeader("content-disposition", strContentDisposition+"; filename=myfile.csv");                        
Response.ContentType = contenttype
Response.TransmitFile(strSourceFilepath);
Response.Flush();

Why this strange behaviour for SSL certificate enabled version? Please help me or advise something to sort it out.

WebServer          : IIS 7.0
Server Language    : ASP.NET
SSL                : Enabled
4

2 回答 2

1

您的内容类型不应该是: Content-type: text/csv

于 2013-04-16T14:23:50.563 回答
1

请参阅以下内容

如果你使用IE,你可能会解决这个问题。

C# BinaryWrite over SSL

或者

使用 ASP.NET 在 IE8 中通过 https 下载文件

于 2013-04-16T15:07:50.620 回答