Created
April 6, 2019 07:32
-
-
Save setu1421/36216700b7fc91e8d4292dca449bb62d to your computer and use it in GitHub Desktop.
Build and send the multipart complete request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Step 3: build and send the multipart complete request | |
if (lastPart) | |
{ | |
eTags.Add(new PartETag | |
{ | |
PartNumber = partNumber, | |
ETag = uploadResponse.ETag | |
}); | |
var completeRequest = new CompleteMultipartUploadRequest | |
{ | |
BucketName = bucketName, | |
Key = fileName, | |
UploadId = uploadId, | |
PartETags = eTags | |
}; | |
var result = _s3Client.CompleteMultipartUpload(completeRequest); | |
//Set the uploadId and fileURLs with the response. | |
response = uploadRequest.UploadId + "|success|" + result.Location + "|"; | |
//For image get thumbnail url | |
if (HasImageExtension(fileName.ToLower())) | |
{ | |
//Send the Thumbnail URL | |
response += result.Location.Replace(uploadRequest.Key, "thumbnail/" + uploadRequest.Key); | |
} else | |
{ | |
response += ""; | |
} | |
} | |
else | |
{ | |
eTags.Add(new PartETag | |
{ | |
PartNumber = partNumber, | |
ETag = uploadResponse.ETag | |
}); | |
//Set the uploadId and eTags with the response | |
response = uploadRequest.UploadId + "|" + GetAllETags(eTags); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment