Welcome Guest, Not a member yet? Register   Sign In
Excel Reader Class, Fatal Error: Allowed memory size...
#1

[eluser]Unknown[/eluser]
Hi, I'm new in CodeIgniter and I'm having a problem about uploading an Excel File into to database.

I've been using this Excel Reader Class by James Gifford. This is quite working properly, I can upload an excel file and it is successfully stored in the database. But the problem is, when I upload a file that exceeds 15 records and up, I always got this error.

Quote: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in /home/dev/web/operations051513/application/libraries/Excel_reader.php on line 537

Here's the part of the code that contains the error...

Code:
/**
     * Convert hexidecimal values to decimal
     *
     * @access private
     * @param string the stream from which to obtain the bytes
     * @param int the offset within the stream to start reading
     * @param int the number of bytes to read from the stream
     * @return long
     */
    function _get_value ($stream, $offset = 0, $length = 1)
    {
       if (strlen($stream) < ($offset + $length) || $length < 1)
        {
            return false;
        }
        
        $string = substr($stream, $offset, $length);
        $value = 0;
        
        for ($i = 0; $i < strlen($string); $i++)
        {
            $value += (ord($string[$i]) * pow(256, $i));
        }
        
        return $value;
    }

Could someone help me with this problem? I've been debugging it for almost a week. Thanks!




Theme © iAndrew 2016 - Forum software by © MyBB