Created
January 25, 2019 19:14
-
-
Save apal21/3dc4b4add9d37582f1d24de8c9e2eb5a to your computer and use it in GitHub Desktop.
AWS S3 getSignedUrl using a callback
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.getSignedUrl('getObject', { | |
Bucket: 'BUCKET-NAME', | |
Key: 'path/to/your/file', | |
Expires: 60 * 5, // time in seconds: e.g. 60 * 5 = 5 mins | |
}, (err, url) => { | |
if (err) throw err; | |
console.log(url); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment