Downloading an Object from a Bucket

You can download an object from one of your buckets or an object that another user shared with you. For more information, see Access Control List (ACL) Reference.

We recommend not exceeding 200 downloads per second from a single bucket.

You can download the current version or any previous version of an object. For more information, see Listing the Versions of an Object.

You can download an object:

  • Through any Software Development Kit (SDK), for example AWS CLI. The object you download is stored where you executed the command, for example in your root directory.

  • From a URL address, following one of these two formats:

    • https://oos.<REGION>.outscale.com/<BUCKET>/<OBJECT_KEY>

    • https://<BUCKET>.oos.<REGION>.outscale.com/<OBJECT_KEY>

Downloading an Object from a Bucket Using AWS CLI (s3api)

Before you begin: Install and configure AWS CLI and set up your profile. For more information, see Installing and Configuring AWS CLI.

To download an object from a bucket, use the get-object command following this syntax:

Request sample
$ aws s3api get-object \
    --profile YOUR_PROFILE \
    --bucket BUCKET \
    --key OBJECT \
    outfile=<~/home/Name_Of_The_Downloaded_Object> \
    --version-id 0CemUck92JnfPoaOG8vX1J2T1wMf1d. \
    [--part-number NOT_SPECIFIED] \
    --endpoint https://oos.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • bucket: The name of the bucket.

  • key: The name of the object in the bucket.

  • outfile: The name for the object once downloaded on your machine. This name can be a path.

    Type the name for the object directly, without the outfile attribute name before it.

  • (optional) version-id: The ID of a previous or current version of the object.

  • (optional) part-number: The part number of an object in a multipart upload. This number must be an integer between 1 and 1000. For more information, see Creating a Multipart Upload.

  • endpoint: The endpoint corresponding to the Region you want to send the request to.

The get-object command returns the following elements:

  • AcceptRanges: The type of accepted ranges of the object.

  • ContentType: The type of content of the object.

  • LastModified: The date and time the object was last uploaded or copied in the bucket.

  • ContentLength: The size of the object, in bytes.

  • ETag: The ETag of the object.

  • VersionID: The ID of a previous or current version of the object.

  • CacheControl: The cache control of the object.

  • Metadata: The metadata of the object, if any.

  • ObjectLockMode: The Object Lock mode of the object.

  • ObjectLockRetainUntilDate: The date, in ISO 8601 format, when the object will no longer be locked.

Result Sample
 {
    "AcceptRanges": "bytes",
    "ContentType": "binary/octet-stream",
    "LastModified": "Mon, 01 Apr 2017 12:12:40 GMT",
    "ContentLength": 42,
    "ETag": "\"e163009009b626ebac1f9876546f8366\"",
    "VersionId": "7395H3JvbAV16lq1tBbxUbtaJ7K4PCP",
    "CacheControl": "public,max-age=3600, private",
    "Metadata": {},
    "ObjectLockMode": "COMPLIANCE",
    "ObjectLockRetainUntilDate": "2024-06-14T15:56:39.979000+00:00"
}

Downloading an Object from a Bucket Using AWS CLI (s3)

Before you begin: Install and configure AWS CLI and set up your profile. For more information, see Installing and Configuring AWS CLI.

You can perform this action using an s3 command following this syntax:

$ aws s3 cp --profile YOUR_PROFILE s3://YOUR_BUCKET/YOUR_OBJECT PATH/TO/FILE --endpoint https://oos.eu-west-2.outscale.com

Downloading an Object from a Bucket Using s3cmd

Before you begin: Install and configure AWS CLI and set up your profile. For more information, see Installing and Configuring AWS CLI.

You can manage your object storage resources using s3cmd commands. For more information, see s3cmd.

Related Pages

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.