Skip to content

Unzipping large zip files? #34

Description

@jmanden

Hi Greggman,

Thank you for making this library available - it is greatly appreciated that you in addition to your webgl tutorials also provides this respository!

I was hoping you could spare a few minutes to help me out!?

Here goes:

I have managed to use the library to unzip a zip file using the following code calling "unzipper":

// Define the lolo function
window.unzipper = async function() {

const {entries} = await unzip('zipTest/dicomTHXMed.zip');

// print all entries and their sizes
for (const [name, entry] of Object.entries(entries)) {
console.log(name, entry.size);
names.push(name);

}

nFiles = names.length;

for(n=0;n<names.length;n++) {

   blobber[n] = await entries[names[n]].blob();
   
   loadFile(blobber[n],n,nFiles);
   
   console.log(n+" : "+n);

}

}


The zip file contains .dcm files at a size each of about 0.5 Mb. The function works fine for extracting the files as a blob when the zip file contains ~ 10 dcm files. However, if I try to unzip a file containing say 100 dcm files (approx 30 Mb compressed) then the browser freezes and gives the error message:
"Uncaught (in promise) Error: invalid local file header signature: 0x0
at readEntryDataHeader (unzipit.module.js:1057:11)
at async readEntryDataAsBlob (unzipit.module.js:1125:39)
at async ZipEntry.blob (unzipit.module.js:697:12)
at async window.lolo "

Is this error due to memory limitation with regards to max size of zip file to be unzipped?
Or am I doing something else wrong?

Kind regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions