Image uploading in to Amazon s3

Sinisreedhar
Posted by in C# category on for Intermediate level | Points: 250 | Views : 5588 red flag

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

Page copy protected against web site content infringement by Copyscape

About the Author

Sinisreedhar
Full Name: sini sreedhar
Member Level: Starter
Member Status: Member
Member Since: 12/20/2012 1:09:38 AM
Country: India
Ready to accept challenges at any time.....
http://www.dotnetfunda.com
more than one year experience in .net,css,javascript,html and ajax

Login to vote for this post.

Comments or Responses

Login to post response

Comment using Facebook(Author doesn't get notification)