0

I want to have a code where I can unzip a zipped file but even after trying so many things, I am not able to do this.

I want this in my front end because I just want to unzip and process the file inside to do some computation with the data inside.

I tried

https://github.com/nika-begiashvili/libarchivejs

I followed this readme but still i got this error,

https://github.com/nika-begiashvili/libarchivejs#readme

but when I try to unzip the file I get this error

enter image description here

Looking at it, it looks like this error is that it is not able to decompress

i checked another popular solution in StackOverflow this is:

first answer of this:

Unzipping files

but I don't know what is

ZipFile in

var zipFile = new ZipFile(url, doneReading)

How can I get it !!

I am so lost, can anyone please help me !!

This is the zip file that I want to compress !!

This is inside my main zip file:

enter image description here

Pravin Poudel
  • 1,433
  • 3
  • 16
  • 38
  • Hm. `3c 21 44 4f` is `<!DO` which is the start of ` `. You probably downloaded an error page. – Raymond Chen Dec 26 '22 at 23:21
  • Isn't ZipFile Java? – zer00ne Dec 26 '22 at 23:22
  • @RaymondChen I am sorry but I dont understand what that means!! I just did what they were suggesting !! What does this mean? – Pravin Poudel Dec 26 '22 at 23:24
  • @zer00ne It is a popular solution in that link !! I don't know !! – Pravin Poudel Dec 26 '22 at 23:24
  • @zer00ne: The other way around, a `.jar` Java package is organized as directories with files inside a `.zip` file – Peter Thoeny Dec 26 '22 at 23:32
  • Maybe this helps? https://github.com/gildas-lormeau/zip.js – Peter Thoeny Dec 26 '22 at 23:37
  • Your libarchive.wasm file did not download properly. Re-download it. – Raymond Chen Dec 26 '22 at 23:57
  • @RaymondChen wasm file ?? – Pravin Poudel Dec 27 '22 at 00:07
  • This is my libarchieve code https://github.com/pravinpoudel/threejs-floodmap/blob/main/src/client/worker.js and my worker-bundle.js in this folder https://github.com/pravinpoudel/threejs-floodmap/tree/main/docs I got this bundle file inside the node_packages which i got after installing libarchive.js – Pravin Poudel Dec 27 '22 at 00:25
  • is this because it is expecting other file? i thought bundled file mean it contain everything it needed, I could not add URI inside the nodmodule in the code https://github.com/pravinpoudel/threejs-floodmap/blob/main/src/client/worker.js#L2 so i added that where the index.html file is . The parameter required is URI. – Pravin Poudel Dec 27 '22 at 00:27

0 Answers0