I want to import excel using php. I have
public function importexcel()
{
$this->img = 'poc.xlsx';
$exceldata = array();
require 'Classes/PHPExcel/IOFactory.php';
try
{
$inputfiletype = PHPExcel_IOFactory::identify( $this->img);
$objReader = PHPExcel_IOFactory::createReader($inputfiletype);
$objPHPExcel = $objReader->load( $this->img);
}
catch(Exception $e)
{
die('Error loading file "'.pathinfo( $this->img,PATHINFO_BASENAME).'": '.$e->getMessage());
}
POC.xlsx
But when I load the page I got an error like
Error loading file "poc.xlsx": Could not open poc.xlsx for reading! File does not exist.
Please help me. Any help would be appreciated.
