简体   繁体   English

错误:文件名try.xlsx在excel_reader2.php中不可读

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

I want to read the Uploaded Excel file in php. 我想在php中阅读Uploaded Excel文件。 so i downloaded excel_reader2.php 所以我下载了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. 谢谢。

PEAR SEW cannot read OfficeOpenXML (.xlsx) format files, only the older BIFF (.xls) format files. PEAR SEW无法读取OfficeOpenXML(.xlsx)格式文件,只能读取较旧的BIFF(.xls)格式文件。 If you want to read .xlsx files, then you need a reader library that does support that format such as PHPExcel 如果您想阅读.xlsx文件,那么您需要一个支持该格式的阅读器库,例如PHPExcel

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM