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