Skip to content

Instantly share code, notes, and snippets.

@marksands
Forked from arfon/S3 uploader
Created January 11, 2010 03:32
Show Gist options
  • Save marksands/273974 to your computer and use it in GitHub Desktop.
Save marksands/273974 to your computer and use it in GitHub Desktop.
require "rubygems"
require "net/http"
require "uri"
require "aws/s3"
AWS::S3::Base.establish_connection!(
:access_key_id => 'ACCESS KEY',
:secret_access_key => 'SECRET KEY'
)
Dir.glob('*.jpg').each do |i|
AWS::S3::S3Object.store(
"#{i}",
File.open(i),
"bucket_name",
:content_type => "image/jpeg",
:access => :public_read
)
puts "Done #{i}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment