AWS S3: List Objects from a specific S3 folder?


I am using the AWS IOS SDK to download files from S3 and am having trouble listing objects in a specific folder of an S3 bucket. I can list all the files of the ENTIRE bucket using the listObjectsInBucket method but I need to list only the files in a specific folder within a bucket.

So I am trying to use the listObjects method and specify a bucket name and prefix (indicating a folder name on S3).

But the following code is not working.


Just simply DO NOT put “/” in front of folderName1, and things will work out.



Leave a Reply