We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

workbook.Save (HttpContext response...no more

Moving from Aspose v8 to 19.4. Upgrade to Core 3.

v8 code was:
using (MemoryStream fstream = memoryStream)
//Specify the LoadOptions and set the memory preferences
var opt = new LoadOptions { MemorySetting = MemorySetting.MemoryPreference };

            //Instantiating a Workbook object, Opening the Excel file through the file stream
            var workbook = new Workbook(fstream, opt);

            //Save file and send to client browser using selected format
            if (saveFormat == SaveFormat.Xlsx)
                workbook.Save(HttpContext.Response, fileName, ContentDisposition.Attachment, new OoxmlSaveOptions(saveFormat));
                workbook.Save(System.Web.HttpContext.Current.Response, fileName, ContentDisposition.Attachment, new XlsSaveOptions(SaveFormat.Excel97To2003));

v19 ‘workbook.Save’ has no overload for response object.

Question is how is the Save to a response context handled in v19?


We have investigated the issue and observed that support for saving file to response object is present for .NET environment as follows:

Saving file to response object

Sample Code

HttpResponse Response = null;

// Load your source workbook
Workbook workbook = new Workbook();

if (Response != null)
    // Save in Excel2003 XLS format
    workbook.Save(Response, dataDir + "output.xls", ContentDisposition.Inline, new XlsSaveOptions());

For its support in .NET Core and .NET Standard environment, we have logged an investigation ticket for detailed analysis. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as
CELLSNETCORE-54 – Support for saving file to response object in ASP.NET Core Web application


We have investigated your issue in details. We found that “System.Web.HttpResponse” class only exists in .NET framework, Please note, .NETStandard20 does not contain class i.e., “System.Web.HttpResponse”. So we removed the relevant Workbook.Save() overloaded(s) in Aspose Cells for .NET Standard2.0 version.

We suggest you to kindly try using:
public void Save(Stream stream, SaveOptions saveOptions) for saving workbook to a stream, then you may add an HttpHead ahead of the stream by yourself.

Hope, this helps a bit.


This is to inform you that we have fixed your issue now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.