-
-
Save Shubhamhirau18/b16431815cfa03f426fee549405d0148 to your computer and use it in GitHub Desktop.
Python S3 File Upload
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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