0

what function/technique in aws phpsdk which equals with s3cmd ls s3://

i have the files uploaded into s3, which structure:

folder_a/file_a.ext
folder_a/file_aa.ext
folder_b/file_b.ext
folder_b/file_bb.ext

I need to list first the folder without the all file names which can be done in s3cmd, but I want to do it in php

herlambang
  • 185
  • 2
  • 9

1 Answers1

0

There is get_bucket_list() wich lists the buckets in you S3, and there is get_object_list() wich gives you a list of objects in a bucket.

For further uses see the API documentation here.

Hope that this is what you are looking for.

Edit:

IF you just want the file names then you can loop through the results you get and use PHP basename() function.

Oussama Jilal
  • 7,669
  • 2
  • 30
  • 53