Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Ruby wrapper around the s3cmd command to allow S3 uploads with progress tracking.
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
vendor
.gitignore
.rspec
Gemfile
Gemfile.lock
MIT_LICENSE
README.rdoc
Rakefile
s3cmd.gemspec

README.rdoc

S3Cmd

S3Cmd is a minimal wrapper around the s3cmd command line interface created for the sole purpose of being able to track upload progress to S3 from ruby.

The gem comes packaged with a very slightly modified version of s3cmd so no need to install it on the system.

Installation

(sudo) gem install s3cmd

Usage

Require the gem

Unless you are using bundler of course.

require 'rubygems'
require 's3cmd'

Configure

First you'll want to configure S3Cmd with your aws credentials.

S3Cmd.configure do |config|
  config.access_key = "your_access_key"
  config.secret_key = "your_secret_key"
  config.use_https = true or false
end

Uploading files

Time to get down to business.

S3Cmd.put("path/to/a/file.ext", "s3://name-of-a-bucket/path/to/destination.ext") do |progress|
  puts progress # 0.0 .. 1.0
end
Something went wrong with that request. Please try again.