node-unzip icon indicating copy to clipboard operation
node-unzip copied to clipboard

Returns an 'invalid distance code' error.

Open lysdexia opened this issue 11 years ago • 0 comments

Archive contains a number of text files. Archive works fine using unzip on unix.

{ [Error: invalid distance code] errno: -3, code: 'Z_DATA_ERROR' }

var fs = require('fs');
var unzip = require('unzip');

var path = 'archive.zip';
var incoming = fs.createReadStream(path).pipe(unzip.Parse());

incoming.on('error', function errorCB (error) {
    if (error) {
        callback(error);
        return;
    }
});

incoming.on('entry', function entryCB (entry) {
    if (self._isArchive(entry.path) === false) {
        entry.autodrain();
    } else {
        console.log(entry.path);
    }
});

lysdexia avatar Oct 10 '14 14:10 lysdexia