S3 with Railo
Some of you may know that there is a Amazon S3 CFC you can download from RiaForge. Railo has an own way of handling Amazon S3 resources.
When you want to use Amazon S3 it can become quite challenging to use the service for storing and reading data with CFML. Here the amazon S3 CFC helps a little.
Since Railo 2.0 introduced resources (virtual file systems) and everything file based in Railo is based on these resources, we have implemented a new resource called S3.
This resource can be used as any other resource as well. So if you have an accessKeyID and a secretAccessKey, you can use it quite easy like follows:
<cffile action="copy" source="s3://[accessKeyID]:[secretAccessKey]@s3.amazonaws.com/susi.txt"
destination="c:\susi.txt">
Now, if you define a mapping that points to a S3 resource like follows:
MappingName:
/myS3Storage
Resource path
s3://[accessKeyID]:[secretAccessKey]@s3.amazonaws.com/
you can use it in your code like this:
<cfinclude template="/myS3Resource/susi.cfm"> <!--- or --->
<cfif fileExists("/myS3Resource/susi.cfm")>
...
</cfif>
<cfdirectory dir="/myS3Resource" action="list" name="s3Files>
<cfdump eval="s3Files">
So it is very easy to store your video files you convert with
Updated: December 15th, 2009
Railo's Amazon S3 extension is a paid extension. If you need information about availability / cost, please Contact us.



Andrew.
<cffile
action = "copy"
source = "C:\mystuff\pics\balloons3d.jpg"
destination = "/myS3Storage/andrew/files/balloons3d.jpg"
acl = "public-read"
>
Andrew.
However, I am able to connect with a different freeware utility using the same credentials/
are you using Railo 3.0 or 3.1? This is an extension now in Railo 3.1. In addition you might need to add a certain JAR file and restart the engine.
Have a look at Mark's latest blog posts: http://www.markdrew.co.uk
Gert
The buckets are just like directoriy names appended at the end of the s3resource. Sou your definition can look like this:
s3://[accessKeyID]:[secretAccessKey]@s3.amazonaws.com/[bucketname]
Gert