public AmazonMultiUpload(AmazonS3Client client, string bucket, string key, Metadata metadata, CancellationToken ct)
{
_client = client;
_bucket = bucket;
_key = key;
_blocks = new List<Task<UploadPartResponse>>();
_ct = ct;
// Fire up the multipart upload request...
var req = new InitiateMultipartUploadRequest { BucketName = _bucket, Key = key };
if (metadata != null)
{
foreach (var m in metadata)
{
req.Metadata.Add("x-amz-meta-" + m.Key, m.Value);
}
}
_uploadId = _client.InitiateMultipartUploadAsync(req, _ct).ContinueWith(r => r.Result.UploadId);
}