We upload images to Amazon s3 because it serve the uploaded files more efficient content delivery network of Amazon.This article describes on how to upload image file to Amazon s3.
Introduction
we uploading images to Amazone s3 mainly for speed up the retrieval and also for big storage space..
Objective
This article describes how to upload images to Amazone s3 buckets in c#.
Using the code
For uploading to Amazon s3,first Create a Bucket and upload images to your Bucket. Your data is durably stored and backed by the Amazon S3 Service
Name space Using:
using Amazon.S3.Model;
using Amazon.S3;
using Amazon;
Write the code in the upload button click.
AmazonS3 client = AWSClientFactory.CreateAmazonS3Client("Access Key", "Acess secrete key");
var request = new PutObjectRequest();
request.WithBucketName("BucketName");
request.WithKey(file.Filename);
request.FilePath = filePath;
request.ContentType = file.ContentType;
request.StorageClass = S3StorageClass.Standard;
request.CannedACL = S3CannedACL.BucketOwnerFullControl;
client.PutObject(request);
Conclusion
Uploading images to Amazon S3 is uploading is quite simple and reduces the loading time of site.
Reference
http://aws.amazon.com/articles/Amazon-S3?browse=1