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
I am trying to open a ZIP file which has zip64 support set but JSZip fails to handle that, while unzip or zipinfo and others are working:
Code:
"use strict";
var fs = require("fs");
var JSZip = require("jszip");
// read a zip file
fs.readFile("zip64-test.zip", function(err, data) {
if (err) throw err;
JSZip.loadAsync(data).then(function (zip) {
});
});
Output is:
/tmp/x/node_modules/jszip/lib/zipEntries.js:145
throw new Error("Corrupted zip or bug: expected " + this.centralDirRecords + " records in central dir, got " + this.files.length);
^
Error: Corrupted zip or bug: expected 1 records in central dir, got 0
at ZipEntries.readCentralDir (/tmp/x/node_modules/jszip/lib/zipEntries.js:145:23)
at ZipEntries.load (/tmp/x/node_modules/jszip/lib/zipEntries.js:256:14)
at /tmp/x/node_modules/jszip/lib/load.js:48:24
Other tools:
$ zipinfo -v zip64-test.zip
Archive: zip64-test.zip
There is no zipfile comment.
End-of-central-directory record:
-------------------------------
Zip archive file size: 270 (000000000000010Eh)
Actual end-cent-dir record offset: 172 (00000000000000ACh)
Expected end-cent-dir record offset: 172 (00000000000000ACh)
(based on the length of the central directory and its expected offset)
This zipfile constitutes the sole disk of a single-part archive; its
central directory contains 1 entry.
The central directory is 99 (0000000000000063h) bytes long,
and its (expected) offset in bytes from the beginning of the zipfile
is 73 (0000000000000049h).
Central directory entry #1:
---------------------------
Test-üäöÜÄÖ.txt
offset of local header from start of archive: 0
(0000000000000000h) bytes
file system or operating system of origin: MS-DOS, OS/2 or NT FAT
version of encoding software: 4.5
minimum file system compatibility required: MS-DOS, OS/2 or NT FAT
minimum software version required to extract: 4.5
compression method: deflated
compression sub-type (deflation): normal
file security status: not encrypted
extended local header: no
file last modified on (DOS date/time): 2024 Mar 25 14:20:56
32-bit CRC value (hex): 00000000
compressed size: 2 bytes
uncompressed size: 0 bytes
length of filename: 21 characters
length of extra field: 32 bytes
length of file comment: 0 characters
disk number on which file begins: disk 1
apparent file type: binary
non-MSDOS external file attributes: 000000 hex
MS-DOS file attributes (00 hex): none
The central-directory extra field contains:
- A subfield with ID 0x0001 (PKWARE 64-bit sizes) and 28 data bytes. The first
20 are: 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00.
There is no file comment.
$ unzip -l zip64-test.zip
Archive: zip64-test.zip
Length Date Time Name
--------- ---------- ----- ----
0 2024-03-25 14:20 Test-üäöÜÄÖ.txt
--------- -------
0 1 file
I am trying to open a ZIP file which has zip64 support set but JSZip fails to handle that, while unzip or zipinfo and others are working:
Code:
Output is:
Other tools:
zip64-test.zip
The text was updated successfully, but these errors were encountered: