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.

This is the response object from the CopyObject operation.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceResponse
    Amazon.S3.Model.CopyObjectResponse

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

Syntax

C#
public class CopyObjectResponse : AmazonWebServiceResponse

The CopyObjectResponse type exposes the following members

Constructors

NameDescription
Public Method CopyObjectResponse()

Properties

NameTypeDescription
Public Property BucketKeyEnabled System.Nullable<System.Boolean>

Gets and sets the property BucketKeyEnabled.

Indicates whether the copied object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

Public Property ChecksumCRC32 System.String

Gets and sets the property ChecksumCRC32.

The Base64 encoded, 32-bit CRC32 checksum of the object. This checksum is only present if the object was uploaded with the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

Public Property ChecksumCRC32C System.String

Gets and sets the property ChecksumCRC32C.

The Base64 encoded, 32-bit CRC32C checksum of the object. This checksum is only present if the checksum was uploaded with the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

Public Property ChecksumCRC64NVME System.String

Gets and sets the property ChecksumCRC64NVME.

The Base64 encoded, 64-bit CRC64NVME checksum of the object. This checksum is present if the object being copied was uploaded with the CRC64NVME checksum algorithm, or if the object was uploaded without a checksum (and Amazon S3 added the default checksum, CRC64NVME, to the uploaded object). For more information, see Checking object integrity in the Amazon S3 User Guide.

Public Property ChecksumSHA1 System.String

Gets and sets the property ChecksumSHA1.

The Base64 encoded, 160-bit SHA1 digest of the object. This checksum is only present if the checksum was uploaded with the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

Public Property ChecksumSHA256 System.String

Gets and sets the property ChecksumSHA256.

The Base64 encoded, 256-bit SHA256 digest of the object. This checksum is only present if the checksum was uploaded with the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

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 ContentLength System.Int64 Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property ETag System.String

Gets and sets the property ETag.

Returns the ETag of the new object. The ETag reflects only changes to the contents of an object, not its metadata.

Public Property Expiration Amazon.S3.Model.Expiration

Gets and sets the property Expiration.

If the object expiration is configured, the response includes this header.

Object expiration information is not returned in directory buckets and this header returns the value "NotImplemented" in all responses for directory buckets.

Public Property HttpStatusCode System.Net.HttpStatusCode Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property LastModified System.String

Gets and sets the property LastModified.

Creation date of the object.

Public Property RequestCharged Amazon.S3.RequestCharged

Gets and sets the property RequestCharged.

Public Property ResponseMetadata Amazon.Runtime.ResponseMetadata Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property ServerSideEncryptionCustomerMethod Amazon.S3.ServerSideEncryptionCustomerMethod

Gets and sets the property ServerSideEncryptionCustomerMethod.

If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used.

This functionality is not supported for directory buckets.

Public Property ServerSideEncryptionCustomerProvidedKeyMD5 System.String

Gets and sets the property ServerSideEncryptionCustomerProvidedKeyMD5.

If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key.

This functionality is not supported for directory buckets.

Public Property ServerSideEncryptionKeyManagementServiceEncryptionContext System.String

Gets and sets the property ServerSideEncryptionKeyManagementServiceEncryptionContext.

If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64 encoded UTF-8 string holding JSON with the encryption context key-value pairs.

Public Property ServerSideEncryptionKeyManagementServiceKeyId System.String

Gets and sets the property ServerSideEncryptionKeyManagementServiceKeyId.

If present, indicates the ID of the KMS key that was used for object encryption.

Public Property ServerSideEncryptionMethod Amazon.S3.ServerSideEncryptionMethod

Gets and sets the property ServerSideEncryptionMethod.

The server-side encryption algorithm used when you store this object in Amazon S3 or Amazon FSx.

When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is aws:fsx.

Public Property SourceVersionId System.String

Gets and sets the property SourceVersionId.

Version ID of the source object that was copied.

This functionality is not supported when the source object is in a directory bucket.

Public Property VersionId System.String

Gets and sets the property VersionId.

Version ID of the newly created copy.

This functionality is not supported for directory buckets.

Examples

This example shows how to copy an object from one bucket/key to a different bucket/key.

CopyObject sample


// Create a client
AmazonS3Client client = new AmazonS3Client();

// Create a CopyObject request
CopyObjectRequest request = new CopyObjectRequest
{
    SourceBucket = "amzn-s3-demo-bucket",
    SourceKey = "Item1",
    DestinationBucket = "AnotherBucket",
    DestinationKey = "Copy1",
    CannedACL = S3CannedACL.PublicRead
};

// Issue request
await client.CopyObjectAsync(request);

                

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