S3.Bucket.
download_fileobj
(Key, Fileobj, ExtraArgs=None, Callback=None, Config=None)¶Download an object from this bucket 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')
with open('filename', 'wb') as data:
bucket.download_fileobj('mykey', data)