Skip to content

Extraction of password protected zip entries#457

Merged
cthackers merged 1 commit intocthackers:masterfrom
Santa77:master
Mar 13, 2024
Merged

Extraction of password protected zip entries#457
cthackers merged 1 commit intocthackers:masterfrom
Santa77:master

Conversation

@Santa77
Copy link
Copy Markdown

@Santa77 Santa77 commented May 10, 2023

Addes small changes to extract entries prottected by password. If entrie is not password prottected, it's extracted even password is provided.

var AdmZip = require("adm-zip");

// reading archives
var zip = new AdmZip("./my_file.zip");
var password = "1234567890";
var zipEntries = zip.getEntries(password ); // an array of ZipEntry records - add password parameter if entries are password protected

zipEntries.forEach(function (zipEntry) {
    console.log(zipEntry.toString()); // outputs zip entries information
    if (zipEntry.entryName == "my_file.txt") {
        console.log(zipEntry.getData().toString("utf8"));
    }
});

@cthackers cthackers merged commit a8f7168 into cthackers:master Mar 13, 2024
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

Successfully merging this pull request may close these issues.

3 participants