HTTPS SSL问题
Contents
[
Hide
]
HTTPS/SSL问题
一些用户报告称,使用Aspose.Cells生成的Excel文件下载时出现问题。当保存对话框打开时,文件名包含aspx页面的名称而不是excel文件,并且文件类型为空。
解释
我们更改了HTTP响应标头以解决HTTP压缩问题。这可能会在通过HTTPS/SSL向客户端浏览器发送文件时出现问题。
解决方案
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// Saves file to memory | |
MemoryStream stream = new MemoryStream(); | |
excel.Save(stream, SaveFormat.Excel97To2003); | |
Response.ContentType = "application/vnd.ms-excel"; | |
// This is same as OpenInExcel option | |
Response.AddHeader("content-disposition", "attachment; filename=book1.xls"); | |
// This is same as OpenInBrowser option | |
// response.AddHeader("content-disposition", "inline; filename=book1.xls"); | |
Response.BinaryWrite(stream.ToArray()); |