Managed Hosting



Amazon S3 REST Wrapper
Project Home Blog Forums Known Issues External Project Link Contact Project

Author: Joe Danziger (All RIAForge projects by this author)
Last Updated: August 3, 2011 1:55 PM
Version: 2.1
Views: 114,536
Downloads: 4,789
License: Apache License, Version 2


A CFC for managing all aspects of Amazon's Simple Storage Service, including file and directory (bucket) operations. Uses a REST interface to perform all operations. Meant to be integrated into existing applications.

The CFC has the following methods:
* init(accessKeyID, secretAccessKey) - initialize CFC (both parameters required).
* getBuckets() - List all buckets.
* putBucket(bucketName, acl, storageLocation) - create a new bucket (acl is optional and defaults to public-read, storageLocation is optional and defaults to non-EU. Use 'EU' for the European location contraint).
* getBucket(bucketName, prefix, marker, maxKeys, ShowVersions) - get contents of a bucket (prefix
is optional and matches on the beginning of a key, marker is optional and results
start from there, maxKeys is optional and restricts the number of objects returned).
* deleteBucket(bucketName) - delete a bucket (bucket must be empty).
* putObject(bucketName, fileKey, contentType, HTTPtimeout, cacheControl, cacheDays, acl, storageClass, keyName, uploadDir) - puts an object into a bucket (HTTPtimeout is in seconds - default is 300; cacheControl tells browser to cache object - default is true; cacheDays default is 30; acl = access control list; storageClass = S3 Storage Class; keyName defaults to fileKey; uploadDir defaults to current directory).
* getObject(bucketName, fileKey, minutesValid) - get link to an object (minutesValid
is optional and defaults to 60).
* copyObject(oldBucketName, oldFileKey, newBucketName, newFileKey) - copies an object.
* renameObject(oldBucketName, oldFileKey, newBucketName, newFileKey) - renames an object.
* deleteObject(bucketName, fileKey) - delete an object from a bucket.
* objectExists(bucketName, fileKey) - determines if object exists in bucket.
* setBucketVersioning(bucketName,versioningStatus) - sets versioning on a bucket.
Valid values are 'Enabled' and 'Suspended'
* getBucketVersioning(bucketName) - gets current versioning status of bucket.

NOTE: You may also access your objects via:

Recent Blog Entries:

Last Update:

Added objectExists method to check if item exists on S3. Does a HEAD request for metadata and does not retrieve entire object.

Issue Tracker:

5 xmlSearch incompatibility with CF10 Open 12/30/13 1:34 PM
3 putObject shouldn't assume file key is the same as the real path Fixed 01/06/11 3:24 PM
4 Prefix must resolve to a namespace: Fixed 12/30/10 5:48 PM
2 Feature Request: add metadata info to 'putObject' so you can add cache-control/expires info to S3 files Fixed 12/15/08 3:12 AM
1 getObject() Fixed 06/13/08 12:31 AM

View All Issues

To enter issues for this (or any other) project, you must be logged in.

Subversion Access:

You may access this project's Subversion repository with your client here: http://svn.riaforge.org/amazons3.

To view files and changelists associated with this repository, go here: http://amazons3.riaforge.org/index.cfm?event=page.svnbrowse.

Anonymous users have read access to the repository while the administrator has write access.

This project is sharing its code via Subversion. Subversion is an open source source control method. You may find more information about Subversion here: http://subversion.tigris.org/