php - Error converting a xls file to xlsx with PHPExcel -


i´m making web application in php library phpexcel, 1 functionality convert xls file xlsx. code functionality:

<?php set_include_path(get_include_path() . path_separator . '../phpexcel/classes/'); include 'phpexcel/iofactory.php'; $excelpath="/documents/excel/"; $inputfilename=$_files['file']['name']; $filetype=$_files['file']['type']; $filesize=$_files['file']['size']; $filetemp=$_files['file']['tmp_name']; $extension = substr(strrchr($inputfilename, '.'), 1); if ($extension=="xls"){     $filename= "list_file_to_convert.xls";     $save_as= $excelpath.$filename;     move_uploaded_file($filetemp, $save_as);     $inputfiletype = phpexcel_iofactory::identify($save_as);     $excel = phpexcel_iofactory::load($save_as);     $writer = phpexcel_iofactory::createwriter($excel, 'excel2007');     $writer->save($excelpath."test123.xlsx"); }else{     echo "everything ok, file xlsx has been loaded";  }     ?> 

the problem is, when try use function:

phpexcel_iofactory::load($save_as);

i followings errors:

error phpexcel

the strange thing if load file xlsx format or cvs file, , converted xls or cvs ok, error generated when file loaded xls extension. doing wrong?


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -