S3 putObject callback not returning expected objects S3 putObject callback not returning expected objects express express

S3 putObject callback not returning expected objects


The docs don't imply that the object key will be available in the data callback parameter.

You can work out the S3 URI of the created object based on the bucket's name and the params.Key property on the request data.

Here's an example of how to do that from within the putObject callback

s3Bucket.putObject(data, function(err, data) {  var params = this.request.params;  var region = this.request.httpRequest.region;  console.log('s3://' + params.Bucket + '/' + params.Key);  console.log('https://s3-' + region + '.amazonaws.com/' + params.Bucket + '/' + params.Key)});