Extract a zip archive to buffer generates an invalid zip archive
See original GitHub issueWhen open and extract a zip archive, it fails. Please use the following code and the attachment to reproduce it.
const AdmZip = require('adm-zip')
let zip1 = new AdmZip('./bug-data.zip') //this zip file can be validated by other zip tools (7z, WinRAR), which should be valid.
//zip1.extractAllTo('./extracted1') //this does succeed
//actually the following toBuffer() is buggy. It generates an entry with invalid CRC.
//If you write the buffer to a file and examine with zip tools (e.g. WinRAR), it says one entry is corrupted.
let zip2 = new AdmZip(zip1.toBuffer())
//The following operation will fail: invalid block type
zip2.extractAllTo('./extracted2')
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
5 Methods to Fix Zip File Is Valid Problem
Part 5: Run CMD to Repair/Restore Corrupted Or Invalid Zip Files ... The following method can also be used for erasing zip file...
Read more >Can not open zip file after downloading through nodejs ...
Since a zip file is binary you should use a Buffer. Here is an example replacement for your utils.apiRequest with Buffer: utils.
Read more >How to Fix & Recover Invalid Zip File [2022 Guide]
Option #1: To Unzip the File ... 1. Just open the WinZip & go to folder where your zipped files are located. 2....
Read more >How To Work With Zip Files in Node.js - DigitalOcean
First, you'll combine multiple files into a ZIP archive using adm-zip . You'll then list the ZIP archive contents. After that, you'll add...
Read more >zipfile — Work with ZIP archives — Python 3.11.1 documentation
Source code: Lib/zipfile.py The ZIP file format is a common archive and compression standard. This module provides tools to create, read, write, append, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Possible duplicate of https://github.com/cthackers/adm-zip/issues/289
It should be fixed for now