how to get files in s3 directory like following?
s3://1eM20RW1CJAFGTH5YHs2:ahEbquj3/
W8ZuYE1ZfGK9KblxdZ7ATsHX3Jb59Uk@daociyiyou
how to get files in s3 directory like following?
s3://1eM20RW1CJAFGTH5YHs2:ahEbquj3/
W8ZuYE1ZfGK9KblxdZ7ATsHX3Jb59Uk@daociyiyou
You need to use the AWS::S3 gem: http://amazon.rubyforge.org/
Then, connect to S3:
AWS::S3::Base.establish_connection!(
:access_key_id => ‘access_key_id’,
:secret_access_key => ‘secret_access_key’
)
And send your file:
AWS::S3::S3Object.store(‘file_name’, file_contents, ‘bucket_name’)
Thank you! It seems there is no way to access s3 using the ruby or
rails regular methods.
You can use HTTP calls directly with the Amazon S3 REST API (http://
docs.amazonwebservices.com/AmazonS3/latest/) if you want, but that’s
what the AWS::S3 gem is doing for you anyway - it just saves you a lot
of time.
You can use also the Amazon S3 SOAP API. Ruby and Rails will be able
to interact with either API in a fairly straightforward manner, if you
understand SOAP or REST, but neither have S3 support built in.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs