Click here to Skip to main content
13,149,756 members (82,152 online)
Click here to Skip to main content
Add your own
alternative version


3 bookmarked
Posted 26 Mar 2010

Uploading Multiple Files To Amazon S3 From ASP.NET App

, 26 Mar 2010
The article explains how to add possibility to upload multiple files in one click to Amazon S3 hosting service into an ASP.NET application using Aurigma Image Uploader.

Editorial Note

This article is in the Product Showcase section for our sponsors at CodeProject. These articles are intended to provide you with information on products and services that we consider useful and of value to developers.


When you design an upload-enabled Web application you should decide for yourself where to store uploaded files. Here you can use your server equipment; hence, you have to take care about its scalability, reliability, and security. Another way is to use a third-party solution and do not worry about how your data will be stored. If you choose the second way, take a look at cloud storages; for instance, Amazon Simple Storage Service (Amazon S3). This service provides not only a physical storage but also a simple web services interface to store and retrieve any amount of data. Moreover, Amazon S3 supports POST, which allows uploading files and metadata directly to Amazon S3 from a client browser.

See details at

Amazon S3 Basics

To get started with Amazon S3 you need to create an Amazon Web Services (AWS) account. Right after you do it you obtain your Access Key Id and Secret Access Key. These parameters are used for authentication purposes. Access Key Id identifies the AWS account and Secret Access Key is used to sign AWS requests. To store objects Amazon S3 uses buckets which are quite similar to Internet domain names and must be unique within the Amazon S3. For example, if the object named myphotos/holiday.jpg is stored in the mybucket bucket, then the URL to access this object is Every bucket has an associated access control list (acl) used to verify whether a user is able to access this bucket. Each object represents a file and metadata stored within a bucket using a unique key. A bucket and key together uniquely identify each object stored in the Amazon S3.

Find Amazon S3 documentation at

Aurigma Image Uploader and Amazon S3

As it was mentioned above, Amazon S3 supports direct uploading via HTTP POST requests. It means that to create a new Amazon S3 object you need to send the POST request which identifies the sender and defines the object to be created. While working on module responsible for communication with AWS you have options: either you implement forming of HTTP requests manually or utilize some ready to use upload component. As an example of such component we consider Aurigma Image Uploader. If you are not familiar with this component read the ImagingEnabledSites.aspx topic first.

In a word, Aurigma Image Uploader is a cross-browser and cross-platform application (ActiveX control or Java applet) which sends user-specified files to a server in HTTP POST request. To make it possible to use Image Uploader for uploading to Amazon S3, the component is shipped with a special extender which adjusts the POST request to be compatible with Amazon S3.

Using Image Uploader with Amazon S3 extender frees you from necessary to know Amazon S3 API and prepare requests yourself. All you need is just to provide your AWS account and bucket details to Amazon S3 extender and define a file and metadata to be uploaded. Let’s see how it can be done.


Let’s consider a simple demo written for ASP.NET in C#. It shows how to use Aurigma Image Uploader to upload files directly to Amazon S3.

  1. Create new ASP.NET web site (in Visual Studio 2008 menu File -> New -> Web Site...).
  2. Add ImageUploader and AmazonS3Extender controls to the toolbox. These components are implemented in the Aurigma.ImageUploader.dll which is located in Image Uploader installation folder (typically this is C:\Program Files\Aurigma\Image Uploader 6.5 Dual).
  3. Open your default.aspx in the design mode and drag and drop the ImageUploader and AmazonS3Extender items into the desired positions.
  4. Bind the AmazonS3Extender to ImageUploader via its identifier.
  5. Specify your authentication details (Access Key Id and Secret Access Key) and bucket as values of the corresponding properties.
  6. Set acl and key for Amazon S3 object to be created. Here you can use the ${filename} variable to specify a name of the user-selected file.
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" 

    Inherits="_Default" %>

<%@ Register Assembly="Aurigma.ImageUploader" 

    Namespace="Aurigma.ImageUploader.AmazonS3" TagPrefix="aur" %>
<%@ Register assembly="Aurigma.ImageUploader" 

    namespace="Aurigma.ImageUploader" tagprefix="aur" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 


<html xmlns="">
<head runat="server">
    <title>Amazon S3 Demo</title>
    <form id="form1" runat="server">
        <aur:ImageUploader ID="ImageUploader1" runat="server" 

            height="400" width="600">
        <aur:AmazonS3Extender ID="AmazonS3Extender1" runat="server" 


            AWSAccessKeyId="<%$ _AWSAccessKeyId %>"

            SecretAccessKey="<%$ _SecretAccessKey %>"

            Bucket="<%$ _Bucket %>"



That’s all. Try to run this application and upload files to Amazon S3 directly from your browser.

Note, the _AWSAccessKeyId, _ SecretAccessKey, and _Bucket variables should contain valid Amazon Web Services account details. If you have not Amazon Web Services account, you can try this sample on the Image Uploader online demo (

To learn more about Image Uploader, refer to its online documentation located at; in particular, the topic provides the detailed information about cloud storages supported by Image Uploader.

Free trial version of Image Uploader can be downloaded from official site:


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Aurigma Inc.
This member doesn't quite have enough reputation to be able to display their biography and homepage.
Group type: Organisation

1 members

You may also be interested in...


Comments and Discussions

GeneralMy vote of 1 Pin
nishantsolanki22-Nov-10 3:43
membernishantsolanki22-Nov-10 3:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.170924.2 | Last Updated 26 Mar 2010
Article Copyright 2010 by Aurigma Inc.
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid