excel - The filename feed1.xls is not readable in php -



excel - The filename feed1.xls is not readable in php -

hi want parse excel file using zend framework. went zend developer zone , found solution download phpexcelreader. downloaded code set project @ localhost , run code. when treid read .xlsx file generates error

the filename feed1.xlsx not readable

i saved file in .xls format , run code parsed file successfully. want implement in project developed in zend framework. created model, , in project , require_onceed excelreader @ top of project this.

require_once 'excelreader/excel/reader.php'; class excelreadermodel extends zend_db_table { function readfile() { $data = new spreadsheet_excel_reader(); // set output encoding. $data->setoutputencoding('cp1251'); //$data->read('excelreader/excel/feed1.xls'); $data->read('feed1.xls'); echo '<pre>'; print_r($data); echo '</pre>'; } }

i called model function in controller. generating same error found on localhost using .xlsx files. reading .xls file parsed code running @ simple project on localhost.i running zend framework @ local.

what wrong in code? or there way same task.?

as best can tell, error seeing set line of code:

if(!is_readable($sfilename)) { $this->error = 1; homecoming false; }

for 1 reason or another, cannot read file giving, either because there permissions/user issue, or path file wrong.

if on *nix server, should create sure user running webserver has permission read excel file. web server running different user owns file. can seek setting permissions 666.

if ins't finding file, providing total path may help, (e.g. $data->read('/usr/local/apache2/htdocs/excelreader/feed1.xls');

php excel zend-framework

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -