Resources



Sample Code and Libraries

Amazon S3 Library for REST in C#

Click for a printer friendly version of this document Printer Friendly Save to del.icio.us
Average Review:

A library in C# for working with the Amazon S3 REST interface.

Submitted By: EricW@AWS  
AWS Products Used: Amazon S3
Language(s): C#
License: New BSD

About This Sample

  • A library in C# for working with the Amazon S3 REST interface.
  • Part of a collection of interface libraries, each in a different language.
  • See the README file in the download for more information about the sample.

What's New?

  • 2007-12-03: Fix for broken URL encoding.
  • 2007-11-05: Updates to support EU, fixed resource leak.
  • 2007-05-18: Updates to support signed HTTP requests to virtual hosted buckets.
  • 2007-04-23: Updates to support binary uploads.
  • 2006-10-02: Updates for server access logging.
  • 2006-06-16: Updates to use the list delimiter; fix a character encoding issue; add a new S3Tests.cs file; add the status, x-amz-id-2, and x-amz-request-id to the response object; and other updates.

Prerequisites

  • You must be signed up to use Amazon S3. You can sign up for Amazon S3 at http://aws.amazon.com/s3.
  • This sample was built using Visual Studio 2005, but works with the .NET Framework 1.1 and later.

Using the Sample

  • Open the S3Sample.csproj file in Visual Studio.

Discussion

The 5 most recent discussion messages. View full discussion.

jamesvtc
Posts: 1
Registered: 8/14/08
Amazon S3 Library for REST in C#
Posted: Aug 14, 2008 12:38 PM PDT
 
  Click to reply to this thread Reply

I've setup the code in .Net and set the Access and Secret Key and get the following 'Protocol Error' error ...


ProtocolError

   at com.amazon.s3.AWSAuthConnection.makeRequest(String method, String bucket,
String key, SortedList query, SortedList headers, S3Object obj) in C:\Documents
and Settings\Administrator\Desktop\s3-example-cs-library\s3-example-libraries\cs
\AWSAuthConnection.cs:line 359
   at com.amazon.s3.AWSAuthConnection.checkBucketExists(String bucket) in C:\Doc
uments and Settings\Administrator\Desktop\s3-example-cs-library\s3-example-libra
ries\cs\AWSAuthConnection.cs:line 129
   at S3Sample.S3Driver.Main(String[] args) in C:\Documents and Settings\Adminis
trator\Desktop\s3-example-cs-library\s3-example-libraries\cs\S3Driver.cs:line 53

I'm running VS 2005 on .Net2 Framework on OSX via a Parellels Virtual machine, not that should make a difference.

Any help greatly appreciated.

Thanks

Richard.




Reviews
Create Review Write a Review

Works great, but Response doesn't implement IDisposable, Jul 5, 2007 2:48 PM
Reviewer: "erik_cassel"
Be very careful when using this library. If you try to perform a LOT of operations you will quickly run out of Http connections. Here's my solution: 1) com.amazon.s3.Response must implement IDisposable in order to Close the WebResponse on Dispose. 2) Client code must wrap all calls that return a Response with a "using" clause.

Don't see performance boost on EU location, Jan 5, 2008 8:25 AM
Reviewer: appelappel
I tried upload of a 450k file to US and one to EU (US with a previous version built on an old version of this code) and I don't see a performance boost. Googled a bit and DNS has something to do with it at creation time of a bucket... Geert.

name resolution failure, Feb 13, 2008 12:06 AM
Reviewer: xhuyvn
i get this error when run sample. this error happen when check the bucket.
Welcome, Guest Help
Login Login