Menu
Amazon Simple Storage Service
Developer Guide (API Version 2006-03-01)

Retrieving Object Versions

A simple GET request retrieves the current version of an object. The following figure shows how GET returns the current version of the object, photo.gif.

To retrieve a specific version, you have to specify its version ID. The following figure shows that a GET versionId request retrieves the specified version of the object (not necessarily the current one).

Using the Console

For instructions see, Downloading an Object in the Amazon Simple Storage Service Console User Guide. You will need to click the Show button in the console to list all object versions.

Using the AWS SDKs

For examples of uploading objects using AWS SDKs for Java, .NET, and PHP, see Getting Objects. The examples for uploading objects in a nonversioned and versioning-enabled buckets are the same, although in the case of versioning-enabled buckets, Amazon S3 assigns a version number. Otherwise, the version number is null.

For information about using other AWS SDKs, see Sample Code and Libraries.

Using REST

To retrieve a specific object version

  1. Set versionId to the ID of the version of the object you want to retrieve.

  2. Send a GET Object versionId request.

Example Retrieving a Versioned Object

The following request retrieves version L4kqtJlcpXroDTDmpUMLUo of my-image.jpg.

Copy to clipboard
GET /my-image.jpg?versionId=L4kqtJlcpXroDTDmpUMLUo HTTP/1.1 Host: bucket.s3.amazonaws.com Date: Wed, 28 Oct 2009 22:32:00 GMT Authorization: AWS AKIAIOSFODNN7EXAMPLE:0RQf4/cRonhpaBX5sCYVf1bNRuU=

Retrieving the Metadata of an Object Version