Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

aws list all files in s3 bucket node js aws

// Array of all keys in s3 bucket
const findKeys = async(bucketName)=>{
    const {Contents} =  await s3.listObjects({Bucket: bucketName}).promise()
    const keysArr = []
    for(const obj of Contents){
        keysArr.push(obj.Key)
    }
    return keysArr
}
 
PREVIOUS NEXT
Tagged: #aws #list #files #bucket #node #js #aws
ADD COMMENT
Topic
Name
7+6 =