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
javascript node.js amazon-s3


source to share


No one has answered this question yet

Check out similar questions:

2817
How can I upload files asynchronously?
2701
How do I get the values ​​of a query string in JavaScript?
2429
Can (a == 1 && a == 2 && a == 3) ever evaluate to true?
2414
How can I find out which radio button is selected using jQuery?
2288
How can I convert a string to boolean in JavaScript?
2284
How can I combine properties of two JavaScript objects dynamically?
2245
How do I refresh the page using jQuery?
2201
How do you decide when to use Node.js?
1966
How can I select an element with multiple classes in jQuery?
1854
When should you use double or single quotes in JavaScript?


Loading...
X
Show
Funny
Dev
Pics