PHPExcel like on youtube doesn't work. Erros already at the beginning.

Hello,

I am trying to import a excel file like on youtube. https://www.youtube.com/watch?v=7383uLXeZhk
Already at the beginning script case is trowing bunch of errors. I I don’t understand why! Importing of the project form youtube doesnt work also.

Can some one help? Errors are happening at this point.


$objReader = new PHPExcel_Reader_Excel5();
$objReader->setReadDataOnly(true);
$objPHPExcel = $objReader->load("../../../tmp/".$this->xls_input_ul_name);
$worksheetData = $objReader->listWorksheetInfo("../../../tmp".$this->xls_inout_ul_name);

The new files will be created under link below. This is why dont understand the problem.
C:\Program Files (x86)\NetMake\v81\wwwroot\scriptcase mp
Errors are:
[TABLE=“class: scFormErrorTable, align: center”]
[TR]
[TD=“class: scFormErrorMessage, align: center”] [LEFT]Undefined property: control_project_import_bom_apl::$xls_input_ul_name
file_get_contents(…/…/…/tmp/): failed to open stream: No such file or directory[/LEFT]
[LEFT]Fatal error: Uncaught exception ‘PHPExcel_Reader_Exception’ with message ‘The filename …/…/…/tmp/ is not recognised as an OLE file’ in C:\Program Files (x86)\NetMake\v81\wwwroot\scriptcase\prod hird\phpexcel\PHPExcel\Shared\OLERead.php:89 Stack trace: #0 C:\Program Files (x86)\NetMake\v81\wwwroot\scriptcase\prod hird\phpexcel\PHPExcel\Reader\Excel5.php(1164): PHPExcel_Shared_OLERead->read(’…/…/…/tmp/’) #1 C:\Program Files (x86)\NetMake\v81\wwwroot\scriptcase\prod hird\phpexcel\PHPExcel\Reader\Excel5.php(612): PHPExcel_Reader_Excel5->_loadOLE(’…/…/…/tmp/’) #2 C:\Program Files (x86)\NetMake\v81\wwwroot\scriptcase\app\NSEOS\control_project_import_bom\control_project_import_bom_apl.php(1519): PHPExcel_Reader_Excel5->load(’…/…/…/tmp/’) #3 C:\Program Files (x86)\NetMake\v81\wwwroot\scriptcase\app\NSEOS\control_project_import_bom\control_project_import_bom_apl.php(1056): control_project_import_bom_apl->Valida_campos(NULL, NULL, NULL) #4 C:\Program Files (x86)\NetMake\v81\wwwroot\scriptcase\app\NSEOS\control_projec in C:\Program Files (x86)\NetMake\v81\wwwroot\scriptcase\prod hird\phpexcel\PHPExcel\Shared\OLERead.php on line 89[/LEFT]
[/TD]
[/TR]
[/TABLE]

failed to open stream: No such file or directory -> can you check if the file is even uploaded? [FONT=&quot]Check the tmp dir.

The filename …/…/…/tmp/ is not recognised as an OLE file yes that makes sense since I see no name. The upload apparently went wrong so no file so that error makes sense.[/FONT]

Apparently you use the normal uploader, this is good. But it is not clear how you set it. Files normally get uploaded to the tmp dir and when you close the uploader window they normally get moved to the upload dir that you should have set. Basically you should hardly ever need to fiddle in the tmp dir.
Scriptcase uses the tmp dir for all kinds of stuff. The files you upload first go to that tmp dir then to the dir you need.
You are using standard deployment, if you use advanced deployment you can set the directory where the uploaded file goes to (only in deployment not whilst you are developing).

I did it flowing way. Step by step.

  1. I created control and called it control_project_import_bom
  2. I added a field and called it [SIZE=12px]import_excel[/SIZE]
  3. In Datatype I choosed: Document (File Name)
  4. in onScriptInit: i put the code:
require_once('../../../..'.$this->Ini->path_prod.'/third/phpexcel/PHPExcel.php');
  1. in onValidateSuccess
$objReader = new PHPExcel_Reader_Excel5();
$objReader->setReadDataOnly(true);

$objPHPExcel = $objReader->load("../../../tmp/".$this->xls_input_ul_name);
$worksheetData = $objReader->listWorksheetInfo("../../../tmp".$this->xls_inout_ul_name);

So I don’t know what I did worong.

BR
Christina

Hello,

any idea? I need urgently help?

BR
Christina