Laravel-Excel: is not recognised as an OLE file
Versions
- PHP version: 7.1.12
- Lumen version: 5.5.*
- Package version: 3.1
Description
I get an error on some xls files when importing.
The filename /tmp/laravel-excel-p0Ik8z8RMONZ7664r1feNjsyQPS6vKap is not recognised as an OLE file
how can i solve it?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 18 (3 by maintainers)
@kemalatila I checked your file, but your file seems invalid.
Hello, I faced the same issue in laravel 7 “is not recognized as an OLE file” trying to covert from old format xls to xlsx, and here is the solution I’ve applied using core PhpSpreadsheet
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
$filepathsource = ‘old_format_xls_file’; $filepathdes = ‘new_format_xlsx_file’; $spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($filepathsource); $writer = new Xlsx($spreadsheet); $writer->save($filepathdes);
Hope this help !!!