尝试将 XLS 文件导入我的 mysql 表。 但在下面返回错误。
excelimport/storage/framework/laravel-excel/laravel-excel-BBA94ICWI0E7wrAuLevn89J6OElWa1qR.xls is not recognised as an OLE file
这是我的代码。 我知道,文件格式错误,但是当我保存为 excel(不更改任何内容)时,它运行良好。
但问题是;我的用户会上传这样的文件。 我需要解决它而不说“请再次将您的 xls 文件导出为 excel”。
$file = $request->file('file')->store('import');
Excel::import(new UserImportModel, $file);