Created
June 16, 2015 06:41
-
-
Save nowlinuxing/6bf79c9ad757985854c3 to your computer and use it in GitHub Desktop.
How to get the folder list under the specify folder using AWS-SDK v2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'aws-sdk' | |
client = Aws::S3::Client.new( | |
access_key_id: "your_access_key_id", | |
secret_access_key: "your_access_key", | |
) | |
s3.list_objects(bucket: "your-bucket", prefix: "path/to/folder", delimiter: "/").common_prefixes.map(&:prefix) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment