Answers for "Python3 boto3 put object to s3"

0

Python3 boto3 put object to s3

# 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'))
Posted by: Guest on September-03-2021

Python Answers by Framework

Browse Popular Code Answers by Language