All
How can I download a file so the user sees that it is downloading (like with a stream?)
I am currently using ClosedXML, but if I use the SaveAs method, I
If you are using MVC just use the File() method as follows:
using (XLWorkbook wb = new XLWorkbook())
{
//here you put your data in the WorkBook
//then create a Memory Stream object
using (MemoryStream stream = new MemoryStream())
{
//save the workbook as a MemoryStream
wb.SaveAs(stream);
//use the File method to return a File
return File(stream.ToArray(), "filetype","fileName.extension");
}
}