Skip to content

Get S3 Object content by boto3

Gatsby Lee edited this page Jun 29, 2019 · 2 revisions
import io
import boto3

client = boto3.client('s3')
with io.BytesIO() as bytes_buffer:
    client.download_fileobj(Bucket=bucket_name, Key=object_key, Fileobj=bytes_buffer)
    return bytes_buffer.getvalue()

sidebar

Clone this wiki locally