s3 REST wrapper with ACL and storage choice
Based on the wonderful wrapper that Joe Danziger build about a year ago and the update that Steve Hicks made, I made the wrapper with extra storage choice. You can now choose if you want your bucket stored on the US data storage or in my case the European data storage.Download the new and improved s3 REST wrapper
The modified code now takes into account the ACL and the STORAGE:
* putBucket(bucketName, acl, storage) - create a new bucket with the defined ACL and storage.
I have also modified the S3test.cfm so that it includes a drop down for the storage choice US or EU.
The s3.cfc now also takes into account the 307 redirect "error" you get when using EU storage. All the methods have changed to work with the "new-style" REST API and the 307 redirect. The 2 functions that get this "error" are deleteBucket and putObject, i haven't tested the deleteObject code but if this doesn't work just copy/paste the 307 bit from the other methods.
Enjoy!! And if someone could improve the code that would be even better!! This was a quick fix and it could probably improve here en there :-)
UPDATE: I forgot to mention that I don't use the getObject method to get my files... so that method is not working in this exampel. I use the host mybucket.s3.amazonaws.com/filelocation way of getting to the file.
1282 viewed | 3 opinion(s) | del.icio.us | Digg it | Tjarko @ 14/11/07 12:04 cet



