S3.Client.
upload_fileobj
(Fileobj, Bucket, Key, ExtraArgs=None, Callback=None, Config=None)¶Upload a file-like object to S3.
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.client('s3')
with open('filename', 'rb') as data:
s3.upload_fileobj(data, 'mybucket', 'mykey')