HTTPS SSL の問題
Contents
[
Hide
]
HTTPS/SSL の問題
一部のユーザーは、Aspose.Cells で生成された Excel ファイルのダウンロードに問題があると報告しています。保存ダイアログが開くと、ファイル名には Excel ファイルではなく aspx ページの名前が含まれ、ファイルの種類は空白です。
説明
HTTP 圧縮の問題を解決するために、HTTP 応答ヘッダーを変更しました。これにより、HTTPS/SSL を介してクライアント ブラウザにファイルを送信する際に問題が発生する可能性があります。
解決
This file contains hidden or 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()); |