Home > PHP Framework > Laravel > Solve the problem of import error when using laravel-excel extension package (maatwebsite/excel) in Laravel

Solve the problem of import error when using laravel-excel extension package (maatwebsite/excel) in Laravel

藏色散人
Release: 2021-05-18 09:02:45
forward
2529 people have browsed it

The following tutorial column will introduce Laravel to you when using the laravel-excel extension package (maatwebsite/excel). I hope it will be helpful to friends who need it!

Solve the problem of import error when using laravel-excel extension package (maatwebsite/excel) in Laravel                                                                                                                

Message: The filename /tmp/laravel-excel-xxx is not recognized as an OLE file

Specific error message

  "_debug": {
            "position": "File: /wwwroot/www/api/v1/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLERead.php, Line: 109",
            "error": "Code: 0, Message: The filename /tmp/laravel-excel-40eWbJlPwCeiJ1P40ESlH0nhA9wyjJlM is not recognised as an OLE file",...
Copy after login

Reason

User downloads the import template , but if you change the template extension, an error will be reported. If the template is in xlsx format and the user downloads it and changes it to xls format and then imports it, the error will be reported.

Solution

Allow users to fill in data strictly according to the template format and extension, and the file extension cannot be modified

The above is the detailed content of Solve the problem of import error when using laravel-excel extension package (maatwebsite/excel) in Laravel. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:learnku.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template