node.js - Accepting a GZIP file with NodeJS and Express -
i have service takes in gzip file client, client has header set:
content-type: application/x-gzip
the code accepting incoming data ubiquitous code i've found on net:
var postbody = []; req.on('data', function (chunk){ postbody.push(chunk); }); req.on('end',function(){ var result = postbody.join(''); etc...
the problem is, when @ file, using linux: file myfile says of type data. no longer gzip. not sure go here.
the chunks getting buffers, not strings. should do:
var result = buffer.concat(postbody);
to final gzip.
Comments
Post a Comment