Load stream in Epplus causes disk write error

3

Im upload an excel file and trying to load it into a ExcelPackage. Like this

public static void ImportStuff(Stream stream)
{
   using (ExcelPackage package = new ExcelPackage())
   {
     package.Load(stream);
     ...

My calling method gets the stream from an uploaded file

public  async Task<ActionResult> UploadCsv(int Id, HttpPostedFileBase myfile)
{
    ImportProducts(myfile.InputStream);
}

This will cause a A disk error occurred during a write operation. (Exception from HRESULT: 0x8003001D (STG_E_WRITEFAULT))

Why do a get a write error when I am trying to load something?

asp.net-mvc-4
epplus
asked on Stack Overflow May 16, 2015 by Jepzen • edited May 16, 2015 by Jepzen

1 Answer

2

I was trying to upload a csv file. Not a xslx file. Could have hoped for a more descriptive error message but it is working.

answered on Stack Overflow May 17, 2015 by Jepzen

User contributions licensed under CC BY-SA 3.0