我想在文件夹中列出s3 buket中的文件,我的buket结构是
/> folder_1
a_bucket -> folder_2
\> folder_3
我只想在folder_1中列出文件
答案 0 :(得分:0)
我的问题解决了
s3client.list({ "prefix": "folder_1/" + filePrefix }, function (err, data) {
/* `data` will look roughly like:
{
Prefix: 'my-prefix',
IsTruncated: true,
MaxKeys: 1000,
Contents: [
{
Key: 'whatever'
LastModified: new Date(2012, 11, 25, 0, 0, 0),
ETag: 'whatever',
Size: 123,
Owner: 'you',
StorageClass: 'whatever'
},
⋮
]
}
*/
}