错误:文件名 try.xlsx 在 excel_reader2.php 中不可读
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17141568/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Error:The filename try.xlsx is not readable in excel_reader2.php
提问by snehal
I want to read the Uploaded Excel file in php. so i downloaded excel_reader2.php
我想在 php 中读取上传的 Excel 文件。所以我下载了 excel_reader2.php
from following 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.
谢谢你。
回答by Mark Baker
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
PEAR SEW 无法读取 OfficeOpenXML (.xlsx) 格式文件,只能读取较旧的 BIFF (.xls) 格式文件。如果你想阅读 .xlsx 文件,那么你需要一个支持这种格式的阅读器库,比如PHPExcel