Last active
December 19, 2023 09:56
-
-
Save djmnz/8190656 to your computer and use it in GitHub Desktop.
Getting object size from C# AWS SDK without downloading it
This file contains 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
using (var amazonClient = new AmazonS3Client()) | |
{ | |
var getObjectMetadataRequest = new GetObjectMetadataRequest() { BucketName = RawBucketName, Key = fileName }; | |
var meta = amazonClient.GetObjectMetadata(getObjectMetadataRequest); | |
var fileSize = meta.Headers.ContentLength; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you