刘凡 9ff4d1d109 add S3,archive,truncate | 2 years ago | |
---|---|---|
.. | ||
templates | 2 years ago | |
.gitignore | 2 years ago | |
readme.md | 2 years ago | |
test.py | 2 years ago |
s3multifile By Steve Saporta Apr 25 2014
Illustrates how to upload multiple files to Amazon S3 using:
To run this program, you'll need:
You'll need an AWS bucket and AWS user with appropriate permissions.
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1396533377000",
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:DeleteObject",
"s3:PutObject"
],
"Resource": [
"arn:aws:s3:::mybucket"
]
}
]
}
From the *Security Credentials" tab, create an Access Key. Take note of the Access Key ID and Secret Access Key. Set the following environment variables:
Now use Python 2.7 to launch test.py. In your web browser, visit http://localhost:8080. Select some files and click *Submit. The files should appear in your S3 bucket!