HTTPS SSLの問題
Contents
[
Hide
]
HTTPS/SSLの問題
Aspose.Cellsで生成されたExcelファイルをダウンロードする際に問題が発生したという報告があります。保存ダイアログが開くと、ファイル名にはExcelファイルの代わりにaspxページの名前が含まれ、ファイルタイプは空白です。
説明
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()); |