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,

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b38619-2c112.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b38619-2c112.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?