Created
January 25, 2019 19:33
-
-
Save apal21/33fe97b9ffd670b0891bbb98e2c9ed89 to your computer and use it in GitHub Desktop.
AWS S3 getObject using .then()
This file contains 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 s3 = new AWS.S3(accessparams); | |
s3.getObject({ Bucket: 'BUCKET-NAME', Key: 'path/to/your/file' }) | |
.promise() | |
.then(file => { | |
console.log(file.Body); | |
}) | |
.catch(err => { | |
console.log(err); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment