Downloading an object from a directory bucket
The following code examples show how to read data from (download) an object in an Amazon S3
directory bucket by using the GetObject
API operation.
The following get-object
example command shows how you can use the AWS CLI
to download an object from Amazon S3. This command gets the object
from the directory bucket
KEY_NAME
. The object will be downloaded to a file
named bucket-base-name
--zone-id
--x-s3
. To run this command, replace the LOCAL_FILE_NAME
with your own information.user input placeholders
aws s3api get-object --bucket
bucket-base-name
--zone-id
--x-s3 --keyKEY_NAME
LOCAL_FILE_NAME
For more information, see get-object