Last active
February 16, 2023 18:29
-
-
Save Galaxy83/c1fdeec84d0c0c51ab78057a72385a7b to your computer and use it in GitHub Desktop.
node.js zlib decompress uncompress unzip s3 file getObject buffer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const unzipFromS3 = (key, bucket) => { | |
return new Promise(async (resolve, reject) => { | |
let options = { | |
'Bucket': bucket, | |
'Key': key, | |
}; | |
s3.getObject(options, function(err, res) { | |
if(err) return reject(err); | |
resolve(zlib.unzipSync(res.Body).toString()); | |
}); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am getting the same error, I also got a content type binary/octet but's still not unzipped my keys it will give error header check