3

I am working on import price of products using xls, xlsx, ods and csv files.

For that i need to read these file, i had use seperate external library files to read those files.

It works well in my local machine, when i move it to server my admin controller doesn't work, it displays blank page.

I found that is because i have included external library files in my admin controller.(when i command those lines controller works fine in server)

so then i have used below format to include lib files :

require_once(Mage::getBaseDir('lib'). DS . '[folder_name]/easyODS.php');
require_once(Mage::getBaseDir('lib'). DS . '[folder_name]/simplexlsx.class.php');
require_once(Mage::getBaseDir('lib'). DS . '[folder_name]/reader.php');

after this change xlsx, ods and csv(i didn't use lib file for csv) working fine but xls doesn't.

kindly give me suggestion to do this stuff.

1
  • 1
    anybody faced this issue already? Commented Jul 28, 2016 at 13:28

2 Answers 2

2

I have fixed the issue...simple thing i have done
i have changed the below line in my library file that i used to read .xls file
the line is :

function Spreadsheet_Excel_Reader()
{
    $this->_ole =& new OLERead();
    $this->setUTFEncoder('iconv');
}

Changed To

function Spreadsheet_Excel_Reader()
{
    $this->_ole = new OLERead();
    $this->setUTFEncoder('iconv');
}

I have just removed the '&'(ampersand) from the line. Problem Solved!!!... Now it is working well.

1
  • can you please describe how to call php library in controller ? Commented Oct 17, 2018 at 11:05
0

First of all debug the path :

require_once(Mage::getBaseDir('lib'). DS . '[folder_name]/easyODS.php');

the path which is created able to open file in browser? and then try to add relative path of the file.

3
  • thanks for your answer, i will check with this and let you know Commented Aug 3, 2016 at 7:14
  • i have resolved my issue MageComp..above is my answer Commented Aug 6, 2016 at 6:57
  • this is not workig in controller. Commented Oct 17, 2018 at 11:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.