PHPExcel file Uploader

937 views Asked by At

When i trying to upload temp.xlsx in PHPExcel script it will return an error like Fatal error: Class 'PHPExcel_Shared_String' not found in /home/demo/public_html/include/Classes/PHPExcel/Autoloader.php on line 36 on my server. But when i run same PHPExcel script in my localhost like

<?php
    require_once('Classes/PHPExcel.php');
    require_once('Classes/PHPExcel/IOFactory.php');

    //Usage:
    convertXLStoCSV('input.xlsx','output.csv');

    function convertXLStoCSV($infile,$outfile)
    {
        $fileType = PHPExcel_IOFactory::identify($infile);
        $objReader = PHPExcel_IOFactory::createReader($fileType);

        $objReader->setReadDataOnly(true);  
        $objPHPExcel = $objReader->load($infile);   

        $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'CSV');
        $objWriter->save($outfile);
    }
?>

then it will work properly. I have tried the change the permission of folder over the network but it can not work.

1

There are 1 answers

0
qwerty On BEST ANSWER

It depends upon what versions of PHP and PHPExcel you are running.

http://phpexcel.codeplex.com/workitem/20331

If you are running PHPExcel 1.8.0 with PHP < 5.3.0, then a bug was introduced in the autoloader code that would cause this error. It has been fixed in the latest develop branch code on github