Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138192

Not able to generate the pre signed url for aws s3

$
0
0

Im using the following code to generate the pre-signed url using aws sdk in javascript.

const aws = require("aws-sdk");
const s3 = new aws.S3();
AWS.config.update({
    accessKeyId: "generated access key",
    secretAccessKey: "generated secret key"
})

const s3_param = {
    Bucket: "bucket-name",
    Key: "file-name"
}

const signedUrl = s3.getSignedUrl("putObject", s3_params);
console.log(signedUrl);

This is giving me undefined. If I pass the callback as the 3ed argument, it is not executing the callback at all. What am I missing here?


Viewing all articles
Browse latest Browse all 138192

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>