Skip to content

Instantly share code, notes, and snippets.

@maurostorch
Created October 25, 2013 13:21
Show Gist options
  • Save maurostorch/7154599 to your computer and use it in GitHub Desktop.
Save maurostorch/7154599 to your computer and use it in GitHub Desktop.
upload files to S3-Amazon object storage system
import sys
from boto.s3.connection import S3Connection
from boto.s3.key import Key
conn = S3Connection('s3_access_key','s3_access_pwd')
#conn.create_bucket('first_20131025')
b = conn.get_bucket('first_20131025')
k = Key(b)
k.key=sys.argv[1]
k.set_contents_from_file(open(sys.argv[1]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment