Created
May 17, 2009 19:41
-
-
Save hugs/113136 to your computer and use it in GitHub Desktop.
Use the boto library to upload a file to S3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Right answer.