Non-mini xlsx.js missing "Root Entry" removal for proper ZIP parsing #1736
Labels
No Label
DBF
Dates
Defined Names
Features
Formula
HTML
Images
Infrastructure
Integration
International
ODS
Operations
Performance
PivotTables
Pro
Protection
Read Bug
SSF
SYLK
Style
Write Bug
good first issue
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#1736
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 🤷♂️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 :
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
xlsx.js
in a browser (because this is generated when building the project withmake
) and got a corruption error when opening the xlsx file.If you include the
jszip.js
script beforexlsx.js
it works.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
dist
version.@szilardd
make dist
generates all of the standalone browser files. After doing so,dist/xlsx.full.min.js
is the desired script.ef4aec8796