Skip to content

Instantly share code, notes, and snippets.



Last active Apr 20, 2020
What would you like to do?
import boto3
from boto3.s3.transfer import TransferConfig
def upload_to_s3(file_name, bucket, key, region="us-east-1"):
# Multipart upload config
config = TransferConfig(
multipart_threshold=1024 * 25,
multipart_chunksize=1024 * 25,
s3 = boto3.client("s3", region_name=region)
# Upload file to S3
s3.upload_file(file_name, bucket, key, Config=config)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.