0

I have the following error:

Fatal error: String size overflow in /Users/jMac-NEW/Word_trial/PHPExcel_1.7.8-
with_documentation-msoffice_format/Classes/PHPExcel/Shared/OLERead.php on line 233

The original code is PHPExcels's OLERead.php:

$block = $bl;
$data = '';

while ($block != -2)  {
    $pos = ($block + 1) * self::BIG_BLOCK_SIZE;
    $data .= substr($this->data, $pos, self::BIG_BLOCK_SIZE); // this is line 233
    $block = $this->bigBlockChain[$block];
}
return $data;

The API for this code reads:

/**
 * Read a standard stream (by joining sectors using information from SAT)
 *
 * @param int $bl Sector ID where the stream starts
 * @return string Data for standard stream
 */

How do I either catch this error or prevent it? Try catch doesn't work (bec fatal error?) I also refer to the answer in PHP Excel Memory Limit of 2GB Exhausted reading a 286KB file, which stated that what was "causing the memory overflow was [an .xls file] downloaded in ASCII mode instead of Binary". However, instead of downloading via FTP as per the situation in that post, I retrieved the files using RecursiveDirectoryIterator and RecursiveIteratorIterator. Apparently the file's size I am working with is 28956bytes, very similar situation to that post. But in my case how do I make the change of downloading to Binary VS ASCII?

Please let me know if additional details required.

Community
  • 1
  • 1
forgodsakehold
  • 870
  • 10
  • 26

0 Answers0