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 UploadPart operation.

Inheritance Hierarchy

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

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

Syntax

C#
public class UploadPartResponse : AmazonWebServiceResponse

The UploadPartResponse type exposes the following members

Constructors

NameDescription
Public Method UploadPartResponse()

Properties

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

Gets and sets the property BucketKeyEnabled.

Indicates whether the multipart upload 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 part. This will only be present if the checksum was provided in the request. 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 part. This will only be present if the checksum was provided in the request. 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 part. This will only be present if the checksum was provided in the request. For more information, see Checking object integrity in the Amazon S3 User Guide.

Public Property ChecksumMD5 System.String

Gets and sets the property ChecksumMD5.

The Base64 encoded, 128-bit MD5 checksum of the part. This will only be present if the checksum was provided in the request. 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 checksum of the part. This will only be present if the checksum was provided in the request. 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 checksum of the part. This will only be present if the checksum was provided in the request. For more information, see Checking object integrity in the Amazon S3 User Guide.

Public Property ChecksumSHA512 System.String

Gets and sets the property ChecksumSHA512.

The Base64 encoded, 512-bit SHA512 checksum of the part. This will only be present if the checksum was provided in the request. For more information, see Checking object integrity in the Amazon S3 User Guide.

Public Property ChecksumXXHASH128 System.String

Gets and sets the property ChecksumXXHASH128.

The Base64 encoded, 128-bit XXHASH128 checksum of the part. This will only be present if the checksum was provided in the request. For more information, see Checking object integrity in the Amazon S3 User Guide.

Public Property ChecksumXXHASH3 System.String

Gets and sets the property ChecksumXXHASH3.

The Base64 encoded, 64-bit XXHASH3 checksum of the part. This will only be present if the checksum was provided in the request. For more information, see Checking object integrity in the Amazon S3 User Guide.

Public Property ChecksumXXHASH64 System.String

Gets and sets the property ChecksumXXHASH64.

The Base64 encoded, 64-bit XXHASH64 checksum of the part. This will only be present if the checksum was provided in the request. 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.

Entity tag for the uploaded object.

Public Property HttpStatusCode System.Net.HttpStatusCode Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property PartNumber System.Nullable<System.Int32>

Gets and sets the property PartNumber.

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 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 SSECustomerAlgorithm System.String

Gets and sets the property SSECustomerAlgorithm.

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 SSECustomerKeyMD5 System.String

Gets and sets the property SSECustomerKeyMD5.

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 SSEKMSKeyId System.String

Gets and sets the property SSEKMSKeyId.

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

Examples

This example shows how to upload 13MB of data using mutlipart upload.
The data is contained in a stream and the upload is done in 3 parts: 5MB, 5MB, then the remainder.

Multipart Upload Sample


int MB = (int)Math.Pow(2, 20);

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

// Define input stream
Stream inputStream = Create13MBDataStream();

// Initiate multipart upload
InitiateMultipartUploadRequest initRequest = new InitiateMultipartUploadRequest
{
    BucketName = "amzn-s3-demo-bucket",
    Key = "Item1"
};
InitiateMultipartUploadResponse initResponse = await client.InitiateMultipartUploadAsync(initRequest);

// Upload part 1
UploadPartRequest uploadRequest = new UploadPartRequest
{
    BucketName = "amzn-s3-demo-bucket",
    Key = "Item1",
    UploadId = initResponse.UploadId,
    PartNumber = 1,
    PartSize = 5 * MB,
    InputStream = inputStream
};
UploadPartResponse up1Response = await client.UploadPartAsync(uploadRequest);

// Upload part 2
uploadRequest = new UploadPartRequest
{
    BucketName = "amzn-s3-demo-bucket",
    Key = "Item1",
    UploadId = initResponse.UploadId,
    PartNumber = 2,
    PartSize = 5 * MB,
    InputStream = inputStream
};
UploadPartResponse up2Response = await client.UploadPartAsync(uploadRequest);

// Upload part 3
uploadRequest = new UploadPartRequest
{
    BucketName = "amzn-s3-demo-bucket",
    Key = "Item1",
    UploadId = initResponse.UploadId,
    PartNumber = 3,
    InputStream = inputStream
};
UploadPartResponse up3Response = await client.UploadPartAsync(uploadRequest);

// List parts for current upload
ListPartsRequest listPartRequest = new ListPartsRequest
{
    BucketName = "amzn-s3-demo-bucket",
    Key = "Item1",
    UploadId = initResponse.UploadId
};
ListPartsResponse listPartResponse = await client.ListPartsAsync(listPartRequest);
Debug.Assert(listPartResponse.Parts.Count == 3);

// Complete the multipart upload
CompleteMultipartUploadRequest compRequest = new CompleteMultipartUploadRequest
{
    BucketName = "amzn-s3-demo-bucket",
    Key = "Item1",
    UploadId = initResponse.UploadId,
    PartETags = new List<PartETag>
    {
        new PartETag { ETag = up1Response.ETag, PartNumber = 1 },
        new PartETag { ETag = up2Response.ETag, PartNumber = 2 },
        new PartETag { ETag = up3Response.ETag, PartNumber = 3 }
    }
};
CompleteMultipartUploadResponse compResponse = await client.CompleteMultipartUploadAsync(compRequest);

                

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