Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

list all files in s3 bucket

// 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: #list #files #bucket
ADD COMMENT
Topic
Name
2+3 =