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

ZIP64 Support broken #922

Open
tkrah opened this issue Mar 25, 2024 · 2 comments
Open

ZIP64 Support broken #922

tkrah opened this issue Mar 25, 2024 · 2 comments

Comments

@tkrah
Copy link

tkrah commented Mar 25, 2024

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

zip64-test.zip

@unilynx
Copy link

unilynx commented Apr 22, 2024

Is jszip supposed to implement zip64 at all? I had a hard time finding a confirmation that it intends to do so

@tkrah
Copy link
Author

tkrah commented Apr 22, 2024

Is jszip supposed to implement zip64 at all? I had a hard time finding a confirmation that it intends to do so

https://stuk.github.io/jszip/documentation/limitations.html according to this, imho yes.

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

2 participants