Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you use Amazon S3 via Flex?

Due to the lack of clientaccesspolicy.xml, there appears to be problems with using Amazon S3 via Flex. Are there any work arounds?

Edit: Both of the below answers are great and work, I've upvoted both (I'm not going to assign an answer to the question as they both work):

Can you use Amazon S3 via Flex?

Can you use Amazon S3 via Flex?

like image 997
Mark Ingram Avatar asked Oct 09 '08 11:10

Mark Ingram


3 Answers

You can CNAME a subdomain you control at Amazon S3 (to a bucket with the name of the subdomain), like so:

http://s3.ceejayoz.com/ (goes to my 's3.ceejayoz.com' bucket)

Uploading your own clientaccesspolicy.xml file to the root of that bucket (and setting the permissions to be globally viewable) should do the trick, if I'm understanding your question correctly, as it will be accessible at http://s3.ceejayoz.com/clientaccesspolicy.xml.

More information in the S3 docs: http://docs.amazonwebservices.com/AmazonS3/2006-03-01/index.html?VirtualHosting.html

edit: From looking at that, you could also use the "Example Virtual Hosted Style Method" without a CNAME: http://bucketname.s3.amazonaws.com/clientaccesspolicy.xml

like image 142
ceejayoz Avatar answered Nov 12 '22 09:11

ceejayoz


Yes. You can find an ActionScript 3 library for connecting to S3 at:

http://code.google.com/p/as3awss3lib/

with more information at:

http://weblogs.macromedia.com/cantrell/archives/2007/05/actionscript_li.html

You can look at an example of the API in use by checking out the S3E AIR app at:

http://download.macromedia.com/pub/developer/air/sample_apps/S3E.air

and you can grab the source code from:

http://download.macromedia.com/pub/developer/air/sample_apps/S3E.zip

hope that helps...

mike chambers

like image 26
mikechambers Avatar answered Nov 12 '22 09:11

mikechambers


If you're looking for a working Rails - Flex - S3 example then have a look at this rails project: http://github.com/GreenAsJade/s3-swf-upload-plugin

Its documented and works out of the box. You can even reverse engineer the Flex logic.

like image 1
leviathan Avatar answered Nov 12 '22 11:11

leviathan