node-unzip
node-unzip copied to clipboard
Invalid signature: 0x8080014 when piping from HTTP
I am getting the following error when running node-unzip in combination with a http.get request, then piping it into node-unzip.
The code I use:
var extractor = unzip.Extract({path: tempPath});
extractor.on("close", function() {
log.debug("Done downloading "+file);
callback(null, file);
});
extractor.on("error", function (err) {
log.error(err);
callback(err, null);
});
http.get(url, function (res) {
res.pipe(extractor);
});
tempPath
is defined properly, and the said code works fine on Windows. Now, on my CentOS server, it outputs the error like this: invalid signature: 0x8080014
I'm 100% sure the XML file is valid, the exact file works on Windows.
+1
Have the same issue on Mac. Strange thing is that if I write http response to the zip file on disk and then process it from file it works.
stream.js:94
throw er; // Unhandled stream error in pipe.
^
Error: invalid signature: 0x8080014
Same here @pbochynski
+1 :(
Bad news: This repo appears to be abandoned. Good news: https://www.npmjs.com/package/unzip2 patches this problem and streaming of uncompressed zip content.
It comes down to the lines in lib/parse.js:161
setImmediate(function() {
self._pullStream.unpipe();
self._pullStream.prepend(extra);
self._processDataDescriptor(entry);
});
should be
self._pullStream.unpipe();
self._pullStream.prepend(extra);
setImmediate(function() {
self._processDataDescriptor(entry);
});
Thank you @dvalentiate
Same here @pbochynski
Thanks you as well!! unzip2
fixed a similar problem I had in unzipping folders made with the archiver
module.
Thank you @dvalentiate for the tip. Swichting to unzip2
fixed it for me: :two_men_holding_hands:
Thank you @dvalentiate for the tip. Swichting to unzip2 fixed it for me: 👬
Thanks !!!