Can I get metadata when using "listobjects" on S3 in node?
I can get basic information using "listObjects", but I would like to get the metadata of each object without making another request. At the moment I am using:
var bucket = new AWS.S3({
params: {
Bucket: 'Bucketname',
Prefix: req.body.params.objectId + '/',
Delimiter: '/'
}
});
bucket.listObjects(function(err, data) {
if (err) {
console.log('Could not load objects from S3');
} else {
res.json(data);
}
});
This returns
CommonPrefixes: Array[0]
Contents: Array[1]
Delimiter: "/"
IsTruncated: false
Marker: ""
MaxKeys: 1000
Name: "encore-storage"
Prefix: "Music/Demos/song.mp3"
But I would like to get metadata like "ContentType" without making another call for each object.
+3
source to share
No one has answered this question yet
Check out similar questions: