class AWS::S3


See {S3Object} for more information on reading and writing to S3.
end
f.write(photo.read)
File.open(“/some/path/on/disk.jpg”, “w”) do |f|
Reading from an S3Object:
photo.write(File.read(‘/some/photo.jpg’))
Writing to an S3Object:
photo = s3.buckets.objects[‘photo.jpg’]

Each object in a bucket has a unique key.
== Reading and Writing to S3
in a bucket as a tree. See {ObjectCollection} for more information.
You can limit the list of objects with a prefix, or explore the objects
end
puts object.key #=> no data is fetched from s3, just a list of keys
bucket.objects.each do |object|
Enumerating objects in a bucket:
== Listing Objects
with S3 buckets.
See {Bucket} and {BucketCollection} for more information on working
end
puts bucket.name
s3.buckets.each do |bucket|
Listing buckets:
bucket = s3.buckets[‘mybucket’]
bucket = s3.buckets[:mybucket]

To get a bucket:
bucket = s3.buckets.create(‘mybucket’)
To create a bucket:
S3 stores objects in buckets.
== Buckets Keys and Objects
:secret_access_key => ‘YOUR_SECRET_ACCESS_KEY’)
:access_key_id => ‘YOUR_ACCESS_KEY_ID’,
s3 = AWS::S3.new(
Or you can set them directly on the S3 interface:
:secret_access_key => ‘YOUR_SECRET_ACCESS_KEY’)
:access_key_id => ‘YOUR_ACCESS_KEY_ID’,
AWS.config(
AWS.config:
You can setup default credentials for all AWS services via
== Credentials
* {Amazon S3 Documentation}[http://aws.amazon.com/documentation/s3/]
* {Amazon S3}[http://aws.amazon.com/s3/]

For more information about Amazon S3, see:
.
To use Amazon S3 you must first
Provides an expressive, object-oriented interface to Amazon S3.

def buckets

Returns:
  • (BucketCollection) - Returns a collection that represents all
def buckets
  BucketCollection.new(:config => @config)
end