upload_fileobj
(Fileobj, Key, ExtraArgs=None, Callback=None, Config=None)¶Upload a file-like object to this bucket.
The file-like object must be in binary mode.
This is a managed transfer which will perform a multipart upload in multiple threads if necessary.
Usage:
import boto3
s3 = boto3.resource('s3')
bucket = s3.Bucket('mybucket')
with open('filename', 'rb') as data:
bucket.upload_fileobj(data, 'mykey')