if (strtolower ( $file_type ) == "xls") {
// $objReader = \PHPExcel_IOFactory::createReader("Excel5");
$objReader = new \PHPExcel_Reader_Excel5();
} else {
//excel.xlsx
$objReader = \PHPExcel_IOFactory::createReader("Excel2007");
}
//
//The filename xxx.xls is not recognised as an //OLE file
$val=$objPHPExcel = $objReader->load($filename,"utf-8");
The code is shown above. $filename is the correct file path. Now uploading xls files will report an error The filename xxx.xls is not recognised as an OLE file, but xlsx will be fine. Baidu checked, the writing is basically similar to the above, ask the boss to answer