Using the NPOI package, can an API receive an Excel file (xlsx), use that file in memory to process, then return a second Excel file as the response, all without saving either file to disk, or do the files need to be saved to disk before being used?
I'm trying to return from an API, a Task, and I am getting a NotImplementedException:
System.NotImplementedException: The method or operation is not implemented. at NPOI.XSSF.UserModel.XSSFWorkbook.get_IsHidden()
My API takes an IFormFile that is an Excel workbook as the parameter, parses the data from it, performs some actions including adding a sheet and results from several API calls to that added sheet, and then I want to return the workbook. The workbook will have the original sheet, and the new "Results" sheet. This is for bulk-testing our API by a client so that they can look at batch results at once, rather than one at a time through our web page that was set up for testing.
I did find this page, but not being all that familiar with writing APIs, I'm not sure how to change this to work as returning a Task with it. NPOI export excel directly to frontend without saving it on server. So it seems possible, I'm just not sure how to get over that last hump.
The other examples I've found so far use disk, and if possible I would like to use the files in memory only, since there is no need for them to be kept beyond doing the processing that the API will do. If it is possible, can someone point me to a resource with example?