I am trying to upload file and save data to DB.
IN File only 10 row and 5 column data.(normal sample data)
File has only 24.0 KB (24,576 bytes)

I am using..reader.php and oleread.php
to upload file

But It taking More than 650MB memory (681574400 bytes)

Is any other library Or method Which takes less memory to upload more data.

and compatible for xlsx and xls

How to solve this .Please guide me.

Member Avatar

Can't you save to csv and upload that and then extract the info and insert into the DB (single mysql query)?

Anyway, just had a Google - and came across this:


I changed it a bit and it seems to work very well.

You may need to change:

$this->_ole =& new OLERead();


$this->_ole = new OLERead();

On line 124 of reader.php

Also the error code in oleread.inc can pop up an error (line 168). I got around this with a dirty fix:

Place this on line 33 of oleread.inc:

var $error = '';

That's really not right, but gives you an idea of how you could do it.

No.. bcoz most people uses xlsx /xls files.

But if it reduce memory i will try
Is it any conversion problem happen from xlsx /xls To CSV.?

Can you give me example so i will try using csv