Versioning in Amazon S3 is a way of keeping multiple variants of an object in the same bucket. 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).
You can retrieve object versions in Amazon S3 using the console, AWS SDKs, or REST API.
NoteTo access object versions older than 300 versions, you must use the AWS CLI or the object's URL.
Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/.
In the Buckets list, choose the name of the bucket that contains the object.
In the Objects list, choose the name of the object.
Choose Versions.
Amazon S3 shows all the versions for the object.
Select the check box next to the Version ID for the versions that you want to retrieve.
Choose Actions, choose Download, and save the object.
You also can view, download, and delete object versions in the object overview panel. For more information, see Viewing object properties in the Amazon S3 console.
The examples for uploading objects in nonversioned and versioning-enabled buckets are the same. However, for versioning-enabled buckets, Amazon S3 assigns a version number. Otherwise, the version number is null.
For examples of downloading objects using AWS SDKs for Java, .NET, and PHP, see Downloading objects.
For examples of listing the version of objects using AWS SDKs for .NET and Rust, see List the version of objects in an Amazon S3 bucket.
To retrieve a specific object versionSet versionId
to the ID of the version of the object that you want to retrieve.
Send a GET Object versionId
request.
The following request retrieves version L4kqtJlcpXroDTDmpUMLUo
of my-image.jpg
.
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=
You can retrieve just the metadata of an object (not the content). For information, see Retrieving the metadata of an object version.
For information about restoring a previous object version, see Restoring previous versions.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4