Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XMLReader::open(): Unable to open source data #56

Open
Kryptonit3-zz opened this issue Sep 4, 2018 · 0 comments
Open

XMLReader::open(): Unable to open source data #56

Kryptonit3-zz opened this issue Sep 4, 2018 · 0 comments

Comments

@Kryptonit3-zz
Copy link

Kryptonit3-zz commented Sep 4, 2018

I have a really large XLSX file (150,000 rows, 16 columns). I receive this file from the company I work for and have no control over its format or features.

Before it gives me the XMLReader::open() error, it gives me No loader for type error. I fix this by manually specifying the type as a second parameter like this: $workbook = SpreadsheetParser::open($request->file('spreadsheet'), 'xlsx');

When I attempt to open it I get this error XMLReader::open(): Unable to open source data. I did some searching and saw this was an issue a while back on issue 22 ( #22 ).

I have tried adding libxml_disable_entity_loader(false) before SpreadsheetParser::open() and it still fails.

libxml Version => 2.9.4

What is weird is, that if I open this xlsx file in excel, and then save, and then reattempt the newly saved file it works. Like it somehow fixes an imperfection or something.

I have attached the file in its original format. It errors out. Try opening and saving and then reprocessing and it should work. No idea why. Would like to figure out a way to bypass this added step so I can just process it all in one go from PHP.

Original

SOR_Contractor_Equipment_UXID_Report.xlsx.zip

After I open it with Excel, and go to File->Save-> (rewrites I am assuming).

Resaved_SOR_Contractor_Equipment_UXID_Report.xlsx.zip

P.S. This library is for some reason 4 times faster than box/spout. I originally started with them but it was taking almost 80-90 seconds to parse this file while this library parses it in about 15-20 seconds. On another note, their library can open the file without me having to resave it. I think they use a different opening method though, you use XMLReader::open and I think they use ZipArchive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant