PHPExcel: Exception: Could not open StockREporter.xlsx for reading! File does not exist. in /home4/scale/public_html/czindia/system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php on line 235

Topics: Developer Forum
Jan 7, 2014 at 1:07 PM
Edited Jan 7, 2014 at 1:08 PM
Trying to write a code to import an excel file into a mysql db.

Exception: Could not open StockREporter.xlsx for reading! File does not exist. in /home4/scale/public_html/czindia/system/PHPExcel/Classes/PHPExcel/Reader/Excel2007.php on line 235

This is the error shown despite the correct file permissions and the existance of the file on that path
file permission : 777
file path:same as the file "Excel2007";
Coordinator
Jan 7, 2014 at 2:25 PM
Edited Jan 7, 2014 at 2:28 PM
If your file is in /home4/scale/public_html/czindia/system/PHPExcel/Classes/PHPExcel/Reader/ then you need to tell PHPExcel this, because that directory isn't going to be the current working directory unless you've actively used chdir() to change to that directory.

Note that filenames are also case-sensitive on *nix filesystems, so StockREporter.xlsx !== StockReporter.xlsx
Jan 7, 2014 at 7:32 PM
ok so whatever the directory , i have to change it to that.Suppose it is in the image folder, i have to set it to that..where do i go and change this dir?
Jan 7, 2014 at 8:24 PM
ok i got it,!! thankyou so much....