Export Excel file in .NET web application on load balancing server causes an issue

Hi,

I use Aspose.cells in web application.

This application is running in Load balancing server (with two web server).

This application use the following function to save the file

Aspose.Cells.Workbook.Save(System.Web.HttpContext.Current.Response, FileName, ContentDisposition.Attachment, New XlsSaveOptions(SaveFormat.Xlsx))



from time to time I I have some differents errors.
- The file is not download and there is nothing to happen
- The file can’t be open by Excel

When i test the application in one web server without load balancing all is fine

Il want to know if there are some bests practices to do for load balancing configuration or if i have to use another function or another way to develop this part?

Best regards

Hi,


Well, it should not make any difference whether the application is running on a simple machine or on a load balancing server. But, there is an error in your line of code, please change it as following if it works fine:

Aspose.Cells.Workbook.Save(System.Web.HttpContext.Current.Response, FileName, ContentDisposition.Attachment, New OoxmlSaveOptions(SaveFormat.Xlsx))

//Add this if you still find the issue.

System.Web.HttpContext.Current.Response.End()

Let us know if you still have any issue.


Thank you.