I tried to generate an excel file on my aspx. It works fine on normal http connection. However, it failed on the https connection.
The scenario is:
1. The excel is generated on the click button event.
2. I invoke the save method on the excel object.
excelExportedData.Save(“MyExcelFile.xls”, Aspose.Excel.SaveType.OpenInExcel, Aspose.Excel.FileFormatType.Default, this.Response);
The error given on the excel application:
1. A dialog box with error message "Could not open “https://myserver.com/MyAspxPage.aspx”.
2. Once click on the OK button, another dialog box open "Microsoft excel cannot access the file … "
Would you be able to provide to solution to this?
- Please check your IE security settings.
2. If you cannot figure it out, you can try the follwing method:
2.1 Save the file in your server and provide a link for your customer.
2.2 Save file in stream and try to use your program to stream it to client.
MemoryStream stream = new MemoryStream();
byte data = stream.ToArray();
response.ContentType = “application/vnd.ms-excel”;
response.AddHeader( “content-disposition”,“attachment; filename=MyExcelFile.xls”);
I tried, it does not work.
It has the same problem.
Any other methods?
Does the following code cause the same problem?
FileStream fs1 = new FileStream("d:\\book1.xls", FileMode.Open, FileAccess.Read);
byte data1 = new byte[fs1.Length];
fs1.Read(data1, 0, data1.Length);
this.Response.ContentType = "application/xls";
Response.AddHeader( "content-disposition","inline; filename=book1.xls");
I think maybe https has some restricts on binary data streaming. In our machines, we always use default settings in IE. And most of other users have no difficulties with default settings in IE.
So in your case, the best way may be generating the file on disk and providing your users a link.
We are having the same issue. The example with the filestream is working, but
excel.Save(filename, FileFormatType.Excel2003, SaveType.OpenInExcel, Response);
is not working. Are you setting the headers of the response object?
Found this KB article describing the problem:
This is really urgent for us. Any help would be very appreciated!
Please try this attached version.
Much better We were using 18.104.22.168 and have used it for all the testing. Can we safely replace this file with 22.214.171.124? Not any large changes that I need to know about?
Thanks for great support. Really saved my day
Testing is need. V126.96.36.199 is not a public release.
If you want to use v188.8.131.52 and don't want to re-do the testing. Please try the solution here: http://www.aspose.com/Wiki/default.aspx/Aspose.Cells/HttpsSsl.html .