I am trying to get all the files from a amazon S3 buckets sub folder and make them downloadable in a web page.
I have a bucket called images. Inside that bucket I have some other folders. Now I am trying to get all the files inside that subfolder and show it in a page.
S3 Buckets:
/images
/images/test1/
/images/test2/
/images/test1/1
/images/test1/2
/images/test1/1/item
I have tried like this, but couldn't get the expected result.
// Target files full path : images/test1/1/item
$bucketName = 'images';
$source = '/test1/1/item'
$image = $this->s3->getBucket($bucketName);
foreach ($image as $key=>$data){
$k = $data['name'];
print_r($k); // now this gives me full list of everything inside the images buck