0

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?

Raphael Lima
  • 179
  • 1
  • 14
  • Well you could try to debug it and see what the cause of the problem is or raise an issue on the [codeplexpage](http://epplus.codeplex.com/workitem/list/basic). But im pretty sure you would need to provide an example .xlsx for anyone to provide you with any further information. But since xlsx is a zipped format, you probably hit the 4GB barirer with a 40mb file. – CSharpie Dec 21 '16 at 17:48
  • Possible duplicate of [Huge memory Allocation when using EPPlus Excel Library](http://stackoverflow.com/questions/24562034/huge-memory-allocation-when-using-epplus-excel-library) – CSharpie Dec 21 '16 at 17:50
  • @CSharpie Thank you for the comment. – Raphael Lima Dec 21 '16 at 20:29
  • It's just weird that the xls file can run without a problem and the xlsx doesnt. By the way I couldn't find the answer in the mentioned post, I even sent an email to the OP to see if he manage to fix it. Unfortunately I can't send the data to anyone, it's sensitive information. By the way, I tested with bigger files even and the problem seems to be just with this one. – Raphael Lima Dec 21 '16 at 20:33
  • 1
    The mentioned post doesnt specifically solve your problem, but antiduh describes what is probably the same issue you are having. – CSharpie Dec 21 '16 at 21:49

0 Answers0