Skip to content

Instantly share code, notes, and snippets.

@zabbio
Created December 18, 2013 03:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zabbio/8016958 to your computer and use it in GitHub Desktop.
Save zabbio/8016958 to your computer and use it in GitHub Desktop.
require 'aws-sdk'
AWS.config(
:access_key_id => '********',
:secret_access_key => '*******'
)
s3 = AWS::S3.new
bucket = s3.buckets['birthday-understeer']
t0 = Time.now
upload_file = (ARGV[0])
basename = File.basename(upload_file)
obj = bucket.objects[basename]
File.open (basename) do |file|
obj.multipart_upload do |upload|
upload.add_part(file.read )
end
end
t1 = Time.now
puts "#{t1 - t0} sec"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment