Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upNon-mini xlsx.js missing "Root Entry" removal for proper ZIP parsing #1736
Comments
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 : - var n = k[i].toLowerCase();
+ var n = (zip.FullPaths ? k[i].replace(/^Root Entry[\/]/,"") : k[i]).toLowerCase(); |
erinn tjernagel |
When will it be published? |
I'm trying to develop a new functionality (excel taskpane add-in) and was also trying to use If you include the
Not sure if there is a different way to test changes in a browser? Haven't found a way to create a new browser build in the |
There 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