Hi
We have been using Aspose.Cells successfully for years, but recently our service provider installed a BIG-IP reverse proxy and now Excel downloads fails. It does not happen every time, but very frequently. Previously ISA was used for reverse proxy, and we had no such problems.
A support case was started with F5 Networks (who makes BIG-IP) and their answer is that it fails because BIG-IP resets the connection due to a HTTP protocol error. This does not cause any exceptions in logs on our servers, but the client receives an incomplete file which cannot be opened in Excel.
We are a bit at a loss as to where these protocol error comes from, but since it is Aspose that handles saving the file to the response I hope you might have some insights or previous experience with similar issues.
This is our code that saves the file to the response:
var format = FileFormatType.Excel97To2003;
workbook.Save(filnavn, SaveType.OpenInExcel, format, response, Encoding.UTF8);
HttpContext.Current.ApplicationInstance.CompleteRequest();
I see in the examples on your documentation page for the saving files that you use a Response.End() after saving .xlsx and .pdf, but not after saving .xls. Is this a typo, or does .xls require different handling for some reason?
Different Ways to Save Files|Documentation
This is a support article from F5 describing this issue:
myF5
Note: We are using IIS7.5 on Win2008R2
Hi,
Hi and thanks for your quick response.
This is unlikely to be a browser issue, it happens in different browsers, for a lot of different customers.
Your code suggestion is good, we will try that and see if it has any effect.
We had some problems reproducing this issue in our development environment, but after setting up a cluster using NLB, like we have in our production environment we were able to reproduce it. It seems the combination of NLB on the cluster and BIG-IP on the reverse proxy was the key, while the old combination of NLB on the cluster and ISA on the reverse proxy did not give any issues.
The fix was to change one line of code, from CompleteRequest() to Response.End() like in your code example, and everything works fine
Old code:
workbook.Save(filnavn, SaveType.OpenInExcel, format, response, Encoding.UTF8);
HttpContext.Current.ApplicationInstance.CompleteRequest();
New code:
workbook.Save(filnavn, SaveType.OpenInExcel, format, response, Encoding.UTF8);
response.End();
Thanks for the help
-Rune
Hi,