【发布时间】:2013-03-20 05:42:53
【问题描述】:
我必须将 excel 数据导入我的 mysql 数据库,但我面临“文件名 uploads/dd.xlsx 不可读”。我不知道什么是错误,为什么我的 excel 表不可读... excelreader2.php 的代码是。
function read($sFileName) {
$res = $this->_ole->read($sFileName);
// oops, something goes wrong (Darko Miljanovic)
if($res === false) {
// check error code
if($this->_ole->error == 1) {
// bad file
die('The filename ' . $sFileName . ' is not readable');
}
// check other error codes here (eg bad fileformat, etc...)
}
$this->data = $this->_ole->getWorkBook();
$this->_parse();
}
我做了所有可能的结帐....任何人都可以解决这个....
【问题讨论】:
-
您对该文件有权限吗?在您的应用尝试访问该文件的同时,该文件没有在 Excel 中打开?
-
错误提示..“文件不可读”..只需更改权限
-
什么类型的权限以及如何更改它...???
-
用
bool is_readable ( string $filename )检查文件,如果文件不可读,尝试用bool chmod ( string $filename , int $mode )设置权限 -
我仍然有同样的问题,首先尝试了所有建议...... :((