Non-mini xlsx.js missing "Root Entry" removal for proper ZIP parsing
See original GitHub issueThere is a difference in safegetzipfile
method between xlsx.js & xlsx.mini.js.
One is missing replace(/^Root Entry[\/]/,"")
so I get this error “Cannot find file [Content_Types].xml in zip” every time trying to read a XLSX file 🤷♂️
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:6 (3 by maintainers)
Top Results From Across the Web
xlsx - npm
"Utility Functions" details utility functions for translating JSON Arrays and other common JS structures into worksheet objects. The Zen of ...
Read more >Date in XLSX file not parsing correctly in SheetJs
It is changing the year format. My requirement is to get the data as it is. Sample Code: var workbook = XLSX.readFile( ...
Read more >Parsing Options - SheetJS Community Edition
XLSX.read(data, read_opts) attempts to parse data. ... type, Input data encoding (see Input Type below). raw, false, If true, plain text parsing will...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
When will it be published?
Thanks for reporting (and for the amusing commentary elsewhere 😃
The xlsx.js script was not intended to be used on its own – there are browser builds in the dist/ folder, and nodejs does something different that avoids the problem.
In particular, the mini build uses cfb for zip processing while the “full” build uses a modified jszip and assumes it exists. The CFB library presents a zip file like an OLE blob, with an implied root folder “Root Entry” even though it doesn’t exist in the zip archive.
Fortunately there’s an easy patch. The fix should be applied to https://github.com/SheetJS/sheetjs/blob/master/bits/21_ziputils.js#L32 :