As my first foray into open-source code, I'm releasing a wrapper for interacting with Amazon's Simple Storage Service (S3) via REST. The wrapper is packaged as a CFC and has the following methods:
A simple test script is included which demonstrates the use of the CFC. You must insert your Amazon S3 access keys in the first 2 lines in s3test.cfm, then just pull it up in a browser.
This is an initial release. Future plans include support for Access Control Lists. If you need something else added, let me know.
This script should run on both ColdFusion MX 6 and 7, let me know if you run into any problems.
The current version is 1.1 and you can visit the project page and download here.
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
Project Tracker v2.0 Released
Mike said: great app! thanks heaps.
found a few bugs in the initial install...
-forgot.cfm - no need to inclu...
[More]
Project Tracker v2.0 Released
Nathan said: Hi Joe
I went to check out the demo site http://ajaxcf.com/project... and it throws an error.
Inval...
[More]
Project Tracker v2.0 Released
Lachie said: Wow thanks for creating a version 2. I have extensively used version 1 for my projects. It works gre...
[More]
Project Tracker v2.0 Released
Steve W said: Joe,
You style sheet is missing because a period was left out of the path.
<link rel="styl...
[More]
Project Tracker v2.0 Released
Mark Mandel said: Joe,
Great work! I can't wait to have a play!
Btw, your CSS isn't rendering on your post view pag...
[More]
Thanks again for this amazing script.. i'm stoked at the moment!!
By the way.. you guys did know you can also reach your files thru the following construction... http://bucketnamet.s3.amazonaws.com/name-of-the-fi...
While recently working on a project using Amazon S3, I developed the need to be able to edit the ACL of the buckets I was adding to my S3 account.
Following on from the great work by Joe, I have added ACL compatibility to the putBucket method.
For those of you who are interested, you can download the edited version here - http://www.stevehicksonline.com/2007/06/04/amazon-...
Steve
Prefix must resolve to a namespace:
Has anyone ever seen this before? Id really like to start using s3
As for these "folders", anyone know if you somehow have subfolders within a folder?
@Joe, could you please update the code? You said you fixed it in 1.2, but the only link I can find is to the older version.
<cfset timedAmazonLink = "http://s3.amazonaws.com/#arguments.bucketName#/#ar...(signature)#">
Hope that helps...
Here is the function:
<cffunction name="deleteBucket" access="public" output="false" returntype="string"
description="Deletes a bucket.">
<cfargument name="bucketName" type="string" required="yes">
<cfset var signature = "">
<cfset var dateTimeString = GetHTTPTimeString(Now())>
<!--- Create a canonical string to send based on operation requested --->
<cfset var cs = "DELETE\n\n\n#dateTimeString#\n/#arguments.bucketName#">
<!--- Replace "\n" with "chr(10) to get a correct digest --->
<cfset var fixedData = replace(cs,"\n","#chr(10)#","all")>
<!--- Calculate the hash of the information --->
<cf_hmac hash_function="sha1" data="#fixedData#" key="#variables.secretAccessKey#">
<!--- fix the returned data to be a proper signature
<cfset signature = ToBase64(Hex2Bin("#digest#"))> --->
<cfset signature = URLEncodedFormat(ToBase64(Hex2Bin("#digest#")))>
<!--- delete the bucket via REST --->
<cfhttp method="DELETE" url="http://s3.amazonaws.com/#arguments.bucketName#&quo...; charset="utf-8">
<cfhttpparam type="header" name="Date" value="#dateTimeString#">
<cfhttpparam type="header" name="Authorization" value="AWS #variables.accessKeyId#:#signature#">
</cfhttp>
<cfreturn cfhttp.header>
</cffunction>
Any suggestions welcome,
Andrew.
http://www.coldfusiondeveloper.com.au/go/blog/2008...
and then:
<cfset signature = ToBase64(HMAC_SHA1(variables.secretAccessKey,fixedData)) />