Recently i updated my PhpSpreadsheet version to 1.2.1, and suddenly it stoped reading my xls files. I tried using three methods to get the data within the files, to no sucess.
$inputFileType = IOFactory::identify($filePath);
$reader = IOFactory::createReader($inputFileType);
$spreadsheet = $reader->load($inputFileName);
$sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true);
This returns me "Unable to identify a reader for this file". The old version that used
$reader= IOFactory::load($filePath);
$conteudo = $reader->getActiveSheet()->toArray(null, true, true, true);
returns the same error. Finally, trying to force it as a XLS does not work as well.
$reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();
$reader->setReadDataOnly(true);
$spreadsheet = $reader->load($filePath);
$conteudo = $spreadsheet->getActiveSheet()->toArray(null, true, true, true);
This one at least gives a different error, it says "Your requested sheet index: -1 is out of bounds. The actual number of sheets is 0.".
The weirdest part is that my .csv part is working just fine. If i get the xls file, turn it into a csv and try using the csv code, it works. Also note that these files (xls and csv) are being uploaded by me for data reading, and worked just fine until the update.
I tried reverting the update to 1.1.0, but the problem still persist. Any ideas?