AWS S3 object listing

前端 未结 6 2155
南方客
南方客 2021-02-06 20:52

I am using aws-sdk using node.js. I want to list images in specified folder e.g.\"This

6条回答
  •  执念已碎
    2021-02-06 21:14

    It's working fine now using this code :

    var AWS = require('aws-sdk');
    AWS.config.update({accessKeyId: 'mykey', secretAccessKey: 'mysecret', region: 'myregion'});
    var s3 = new AWS.S3();
    
    var params = { 
     Bucket: 'mystore.in',
     Delimiter: '/',
     Prefix: 's/5469b2f5b4292d22522e84e0/ms.files/'
    }
    
    s3.listObjects(params, function (err, data) {
     if(err)throw err;
     console.log(data);
    });
    

提交回复
热议问题