Skip to content

Instantly share code, notes, and snippets.

View adityaanugrohoo's full-sized avatar

Aditya Nugroho adityaanugrohoo

View GitHub Profile
@djmnz
djmnz / gist:8190656
Last active December 19, 2023 09:56
Getting object size from C# AWS SDK without downloading it
using (var amazonClient = new AmazonS3Client())
{
var getObjectMetadataRequest = new GetObjectMetadataRequest() { BucketName = RawBucketName, Key = fileName };
var meta = amazonClient.GetObjectMetadata(getObjectMetadataRequest);
var fileSize = meta.Headers.ContentLength;
}