PHPExcel import xls file error .xlsx normal

 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

Php
May.16,2021
The problem with

phpexcel version is that I use the opposite version of yours. I can only report an error if I pass xlsx through xls,

.
Menu