im now on working to create import excel/csv to database.
ive tried some extensions, phpoffice/phpexcel, but still can’t find a way.
whenever it tries to load the file, it always shows ‘file does not exist’ message.
ive searched many blogs and posts about the default folder of phpxcel to load the file that we wanted to import, but still no result.
then i tried to placed the excel file inside baseurl folder (Web folder), but still can’t found the file.
but when i tried to access an image, from that folder, the image appears perfectly.
is there any default folder of phpexcel? or is there any other extension that better that phpexcel for import function?
Thank you very much.
here is my load code:
$objPHPExcel = new \PHPExcel();
$objPHPExcel = \PHPExcel_IOFactory::load(\Yii::$app->request->BaseUrl.’/uploads/test.xlsx’);
$sheetData = $objPHPExcel->getActiveSheet()->toArray(null, true, true, true);
here is the error message:
Could not open /advanced/backend/web/uploads/test.xlsx for reading! File does not exist.
and ive also tried using \Yii::$app->basePath for rooting load path, but still get same error.