How to upload to Amazon S3 using .NET HttpClient WITHOUT using your SDK

How do I upload a file to a cart on Amazon S3 using the .NET HttpClient (or WebClient)? This must be done using "PUT".

I can download using the Amazon AWS SDK, but I would like to know how to do it without it. I've been looking at their documentation for hours and still don't get it.

Any help would be greatly appreciated.

My code using SDK:

public static void TestPutObjectAsync() {
        AmazonS3Client client = new AmazonS3Client();
        client.AfterResponseEvent += new ResponseEventHandler(callback);

        PutObjectRequest request = new PutObjectRequest {
            BucketName = BUCKET_NAME,
            Key = "Item1",
            FilePath = FILE_PATH,


public static event EventHandler UploadComplete;

public static void callback(object sender, ResponseEventArgs e) {

        if (UploadComplete != null) {
            UploadComplete(sender, e);



source to share

1 answer

Not sure why you don't want to use the SDK (what it is for), but even if you don't want to use the entire AWSSDK, you can still use parts of it, or at least see how they do it under the covers.

Its open source here:

Ultimately, the answer you are looking for is there - but it may be more work than worth pulling out.



All Articles