AWS SDK Version 4 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Represents an S3 Object. Contains all attributes that an S3 Object has. For more information about S3 Objects refer: http://docs.amazonwebservices.com/AmazonS3/latest/UsingObjects.html

Inheritance Hierarchy

System.Object
  Amazon.S3.Model.S3Object

Namespace: Amazon.S3.Model
Assembly: AWSSDK.S3.dll
Version: 3.x.y.z

Syntax

C#
public class S3Object

The S3Object type exposes the following members

Constructors

NameDescription
Public Method S3Object()

Properties

NameTypeDescription
Public Property BucketName System.String

The name of the bucket containing this object.

Public Property ChecksumAlgorithm System.Collections.Generic.List<System.String>

Gets and sets the property ChecksumAlgorithm.

The algorithm that was used to create a checksum of the object.

Starting with version 4 of the SDK this property will default to null. If no data for this property is returned from the service the property will also be null. This was changed to improve performance and allow the SDK and caller to distinguish between a property not set or a property being empty to clear out a value. To retain the previous SDK behavior set the AWSConfigs.InitializeCollections static property to true.

Public Property ChecksumType Amazon.S3.ChecksumType

Gets and sets the property ChecksumType.

The checksum type that is used to calculate the object’s checksum value. For more information, see Checking object integrity in the Amazon S3 User Guide.

Public Property ETag System.String

Gets and sets the property ETag.

The entity tag is a hash of the object. The ETag reflects changes only to the contents of an object, not its metadata. The ETag may or may not be an MD5 digest of the object data. Whether or not it is depends on how the object was created and how it is encrypted as described below:

  • Objects created by the PUT Object, POST Object, or Copy operation, or through the Amazon Web Services Management Console, and are encrypted by SSE-S3 or plaintext, have ETags that are an MD5 digest of their object data.

  • Objects created by the PUT Object, POST Object, or Copy operation, or through the Amazon Web Services Management Console, and are encrypted by SSE-C or SSE-KMS, have ETags that are not an MD5 digest of their object data.

  • If an object is created by either the Multipart Upload or Part Copy operation, the ETag is not an MD5 digest, regardless of the method of encryption. If an object is larger than 16 MB, the Amazon Web Services Management Console will upload or copy that object as a Multipart Upload, and therefore the ETag will not be an MD5 digest.

Directory buckets - MD5 is not supported by directory buckets.

Public Property Key System.String

Gets and sets the property Key.

The name that you assign to an object. You use the object key to retrieve the object.

Public Property LastModified System.Nullable<System.DateTime>

Gets and sets the property LastModified.

Creation date of the object.

Public Property Owner Amazon.S3.Model.Owner

Gets and sets the property Owner.

The owner of the object

Directory buckets - The bucket owner is returned as the object owner.

Public Property RestoreStatus Amazon.S3.Model.RestoreStatus

Gets and sets the property RestoreStatus.

Specifies the restoration status of an object. Objects in certain storage classes must be restored before they can be retrieved. For more information about these storage classes and how to work with archived objects, see Working with archived objects in the Amazon S3 User Guide.

This functionality is not supported for directory buckets. Directory buckets only support EXPRESS_ONEZONE (the S3 Express One Zone storage class) in Availability Zones and ONEZONE_IA (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones.

Public Property Size System.Nullable<System.Int64>

Gets and sets the property Size.

Size in bytes of the object

Public Property StorageClass Amazon.S3.S3StorageClass

Gets and sets the property StorageClass.

The class of storage used to store the object.

Directory buckets - Directory buckets only support EXPRESS_ONEZONE (the S3 Express One Zone storage class) in Availability Zones and ONEZONE_IA (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones.

Version Information

.NET:
Supported in: 8.0 and newer, Core 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.7.2 and newer