Upload files
Upload files from disk to an S3 bucket
import boto3
def upload_file(key, filepath, bucket):
# upload file from disk to S3 bucket
client = boto3.client('s3')
client.upload_file(
Filename=filepath,
Bucket=bucket,
Key=key
)key = 'key_name'
filepath = 'path'
bucket = 'bucket_name'
# upload file from disk to S3-bucket
upload_file(key=key, filepath=filepath, bucket=bucket)Last updated
Was this helpful?