EPPLUS 4.1 OutOfMemory Exception for "xlsx" files but not "xls" files

1.2k Views Asked by At

I'm using Epplus 4.1 to read the content of uploaded files and insert them into the database, pretty simple operation actually.

However I got reported a bug that for some reason one file is getting out of memory exception when I create the package.

        try
        {
            this._package = new ExcelPackage(file);
        }
        catch (Exception e)
        {

            ValidFile = false;
            log.Error(e);
        }

Exception: Exception of type 'System.OutOfMemoryException' was thrown.

Inner Exception: null

But when I upload the same file but save it as "xls" (Microsoft Excel 97-2003 worksheet) it goes without a hitch!

Note that the file in xlsx format has 27mb and when I save to xls it has 40mb

Does anyone knows what might be going on? Or how can I fix it?

0

There are 0 best solutions below