Skip to content

Instantly share code, notes, and snippets.

@dwdraju
Created September 17, 2019 11:47
Show Gist options
  • Save dwdraju/03bae218ab15d6a799435cbde545dbb1 to your computer and use it in GitHub Desktop.
Save dwdraju/03bae218ab15d6a799435cbde545dbb1 to your computer and use it in GitHub Desktop.
Python S3 File Upload
import boto3
# Create an S3 client
s3 = boto3.client(
's3',
aws_access_key_id='KEY',
aws_secret_access_key='SECRET'
)
filename = '/path/to/file'
bucket_name = 'BUCKET'
# Uploads the given file using a managed uploader, which will split up large
# files automatically and upload parts in parallel.
s3.upload_file(filename, bucket_name, filename)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment