Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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'))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #put #object
ADD COMMENT
Topic
Name
4+1 =