Hi,

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.

Recommended Answers

All 3 Replies

Member Avatar for diafol

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:

http://amiworks.co.in/talk/readingparsing-excel-spreadsheet-using-php/

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

You may need to change:

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

to

$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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.