Skip to content

Instantly share code, notes, and snippets.

@hugs
Created May 17, 2009 19:41
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 hugs/113136 to your computer and use it in GitHub Desktop.
Save hugs/113136 to your computer and use it in GitHub Desktop.
Use the boto library to upload a file to S3
import boto
BUCKET = 'my-awesome-unique-bucket'
filepath = '/path/to/file/filename.zip'
conn = boto.connect_s3()
bucket = conn.lookup(BUCKET)
key = boto.s3.Key(bucket)
key.name = 'filename.zip'
key.set_contents_from_filename(filepath)
@SHAMLIKHAN
Copy link

Right answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment