Error: try.xlsx file name cannot be read in excel_reader2.php

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

from the following link

link

when I pasted this into my code, I got the 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 on Google, I got the link here

After that, I also get the same error.

So can anyone help me where I'm wrong?

Thanks.

+4
source share
1 answer

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

+7
source

Source: https://habr.com/ru/post/1486543/


All Articles