Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error:The filename try.xlsx is not readable in excel_reader2.php

Tags:

php

I want to read the Uploaded Excel file in php. so i downloaded excel_reader2.php

from following link

link

when I inserted this into my code i got following Error:

The filename try.xlsx is not readable.

My code is:

if (file_exists($filepath))
{
    echo "File present";
}

else
{
die('The file ' . $filename . ' was not found');
}

$data = new Spreadsheet_Excel_Reader($filename,false);

$data->read($filename);

$data->val(1, 'A');

echo $data;

So after searching in Google I got link that is Here

After Following this also i am getting same error.

So can any one help me, where I am going wrong?

Thank you.

like image 627
snehal Avatar asked Mar 24 '23 13:03

snehal


1 Answers

PEAR SEW cannot read OfficeOpenXML (.xlsx) format files, only the older BIFF (.xls) format files. If you want to read .xlsx files, then you need a reader library that does support that format such as PHPExcel

like image 56
Mark Baker Avatar answered Apr 05 '23 23:04

Mark Baker