Skip to content

Instantly share code, notes, and snippets.

@Shubhamhirau18
Forked from dwdraju/s3-upload.py
Created May 2, 2021 05:52
Show Gist options
  • Save Shubhamhirau18/b16431815cfa03f426fee549405d0148 to your computer and use it in GitHub Desktop.
Save Shubhamhirau18/b16431815cfa03f426fee549405d0148 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