I hava a broken .xls file,when i tried to use the method canRead($pFilename),it eats up all my memory

Topics: Developer Forum, Project Management Forum, User Forum
Sep 12, 2012 at 8:05 AM

I got a broken .xls file  generating  an error message like 'Excel found unreadable content in 'filename.xls'. Do you want to recover the contents of the workbook? If you trust the source of
this workbook, click yes.'
when i tried to open it in windows 7.

I know we should use correct files to do our work,but when the customer uploads an  incorrect file,our system should get a way to cope with it without any crashes.

so,i use the method canRead($pFilename) to tell whether the file can be read:

$objReader = PHPExcel_IOFactory::createReader('Excel5');


but....i got this:

Allowed memory size of 134217728 bytes exhausted (tried to allocate 71 bytes) in....../PHPExcel/Shared/OLERead.php on line 156


I need help!

Sep 14, 2012 at 7:45 AM

How was this corrupt file actually created?

Sep 14, 2012 at 11:16 AM
MarkBaker wrote:

How was this corrupt file actually created?

i don't know,either,but it does been created....