AWS SDK Version 3 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.

Returns information about the CopyObject response and response metadata.

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

Gets and sets the ETag property.

Public Property Expiration Amazon.S3.Model.Expiration

Gets and sets the Expiration property. Specifies the expiration date for the object and the rule governing the expiration. Is null if expiration is not applicable.

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

Gets and sets the LastModified property.

Public Property RequestCharged Amazon.S3.RequestCharged

If present, indicates that the requester was successfully charged for the request.

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

The Server-side encryption algorithm to be used with the customer provided key.

Public Property ServerSideEncryptionCustomerProvidedKeyMD5 System.String

The MD5 of the customer encryption key specified in the ServerSideEncryptionCustomerProvidedKey property. The MD5 is base 64 encoded. This field is optional, the SDK will calculate the MD5 if this is not set.

Public Property ServerSideEncryptionKeyManagementServiceEncryptionContext System.String

Specifies the AWS 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

The id of the AWS Key Management Service key that Amazon S3 uses to encrypt and decrypt the object.

Public Property ServerSideEncryptionMethod Amazon.S3.ServerSideEncryptionMethod

The Server-side encryption algorithm used when storing this object in S3.

Public Property SourceVersionId System.String

Gets and sets the SourceVersionId property. This is the Version Id of the Source Object

Public Property VersionId System.String

Version ID of the newly created copy.

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 = "SampleBucket",
    SourceKey = "Item1",
    DestinationBucket = "AnotherBucket",
    DestinationKey = "Copy1",
    CannedACL = S3CannedACL.PublicRead
};

// Issue request
client.CopyObject(request);

                

Version Information

.NET Standard:
Supported in: 2.0, 1.3

.NET Framework:
Supported in: 4.5, 4.0, 3.5

Portable Class Library:
Supported in: Windows Store Apps
Supported in: Xamarin Android
Supported in: Xamarin iOS (Unified)
Supported in: Xamarin.Forms

Unity:
Supported Versions: 4.6 and above
Supported Platforms: Android, iOS, Standalone