📜  Python3 boto3 将对象放入 s3 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:23.555000             🧑  作者: Mango

代码示例1
# Boto 2.x
from boto.s3.key import Key
key = Key('hello.txt')
key.set_contents_from_file('/tmp/hello.txt')

# Boto 3
s3.Object('mybucket', 'hello.txt').put(Body=open('/tmp/hello.txt', 'rb'))