The InitiateMultipartUploadResponse contains all the information about the
InitiateMultipartUpload method.
Declaration Syntax
C# |
public class InitiateMultipartUploadResponse : S3Response
Members
All Members | Constructors | Methods | Properties | ||
Icon | Member | Description |
---|---|---|
InitiateMultipartUploadResponse()()()() | Initializes a new instance of the InitiateMultipartUploadResponse class | |
AmazonId2 |
Gets and sets the AmazonId2 property.
This property corresponds to the x-amz-id-2 header in the HTTP response from the Amazon S3 service. The value of this header is used for internal troubleshooting purposes.
(Inherited from S3Response.) | |
BucketName |
Gets and sets the name of the bucket.
| |
Dispose()()()() |
Disposes of all managed and unmanaged resources.
(Inherited from S3Response.) | |
Equals(Object) | (Inherited from Object.) | |
GetHashCode()()()() | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType()()()() | Gets the type of the current instance. (Inherited from Object.) | |
Headers |
Gets and sets the Headers property.
(Overrides S3Response.Headers.) | |
Key |
Gets and sets the object key for which the multipart upload was initiated.
| |
Metadata |
Gets and sets the Metadata property.
(Inherited from S3Response.) | |
RequestId |
Gets and sets the RequestId property.
(Inherited from S3Response.) | |
ResponseStream |
Gets and sets the ResponseStream property. This property
only has a valid value for GetObjectResponses. In order to
use this stream without leaking the underlying resource, please
wrap access to the stream within a using block.
(Inherited from S3Response.)CopyC# | |
ResponseXml |
Gets and sets the ResponseXml property. This is the
original xml response received from S3
(Inherited from S3Response.) | |
ServerSideEncryptionMethod |
Gets and sets the ServerSideEncryptionMethod property.
Specifies the encryption used on the server to
store the content.
Default is None.
| |
StatusCode |
Gets the HTTP Status code from the service response.
(Inherited from S3Response.) | |
ToString()()()() |
String Representation of this object. Overrides Object.ToString()
(Inherited from S3Response.) | |
UploadId |
Gets and sets the initiated multipart upload id.
|
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.
CopyMultipart 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 = "SampleBucket", Key = "Item1" }; InitiateMultipartUploadResponse initResponse = client.InitiateMultipartUpload(initRequest); // Upload part 1 UploadPartRequest uploadRequest = new UploadPartRequest { BucketName = "SampleBucket", Key = "Item1", UploadId = initResponse.UploadId, PartNumber = 1, PartSize = 5 * MB, InputStream = inputStream }; UploadPartResponse up1Response = client.UploadPart(uploadRequest); // Upload part 2 uploadRequest = new UploadPartRequest { BucketName = "SampleBucket", Key = "Item1", UploadId = initResponse.UploadId, PartNumber = 2, PartSize = 5 * MB, InputStream = inputStream }; UploadPartResponse up2Response = client.UploadPart(uploadRequest); // Upload part 3 uploadRequest = new UploadPartRequest { BucketName = "SampleBucket", Key = "Item1", UploadId = initResponse.UploadId, PartNumber = 3, InputStream = inputStream }; UploadPartResponse up3Response = client.UploadPart(uploadRequest); // List parts for current upload ListPartsRequest listPartRequest = new ListPartsRequest { BucketName = "SampleBucket", Key = "Item1", UploadId = initResponse.UploadId }; ListPartsResponse listPartResponse = client.ListParts(listPartRequest); Debug.Assert(listPartResponse.Parts.Count == 3); // Complete the multipart upload CompleteMultipartUploadRequest compRequest = new CompleteMultipartUploadRequest { BucketName = "SampleBucket", 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 = client.CompleteMultipartUpload(compRequest);
Inheritance Hierarchy
Object | ||
S3Response | ||
InitiateMultipartUploadResponse |