mardi 13 octobre 2015

AWS S3 list files in specific folder

I'm trying to list the files and folders in a specific folder in a S3 bucket. I would like to return the subfolder names in that folder, but not the contents of those subfolders.

I'm not sure if it can be done with the delimiter, but this is what I have:

$objects = $s3->getListObjectsIterator(array(
    'Bucket' => 'BUCKET NAME',
    'Prefix' => 'SUBFOLDER NAME/',
    'Delimiter' => '/'
));

foreach ($objects as $object) {
    echo $object['Key'] . "<br/>";
}




Aucun commentaire:

Enregistrer un commentaire