You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Load XLS files created outside of Excel: We have some XLS files that are created by Facebook's LeadGen forms, they have the extension .xls, but their content is XML.
What is the current behavior?
When I load the file through:
IOFactory::load(Storage::path($path))
PhpSpreadsheet throws the exception:
DOMDocument::loadHTML(): Tag workbook invalid in Entity, line: 5
The reason it does this is because in the method \PhpOffice\PhpSpreadsheet\Reader\Xml::canRead() there is a signature variable:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.
This is:
What is the expected behavior?
Load XLS files created outside of Excel: We have some XLS files that are created by Facebook's LeadGen forms, they have the extension .xls, but their content is XML.
What is the current behavior?
When I load the file through:
PhpSpreadsheet throws the exception:
The reason it does this is because in the method \PhpOffice\PhpSpreadsheet\Reader\Xml::canRead() there is a signature variable:
Which tries to find it in the first bytes of the file, but in the case of these files they don't have the string:
So it returns false and loads the Html reader.
What are the steps to reproduce?
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:
Sorry, I have to rely on an external file to be able to reproduce this issue:
test.zip
If I remove the line in the method: \PhpOffice\PhpSpreadsheet\Reader\Xml::canRead()
It loads as an XML file correctly.
Which versions of PhpSpreadsheet and PHP are affected?
1.2.1
The text was updated successfully, but these errors were encountered: