Tuesday, 4 May 2021

S3 file upload using boto3 in python


import boto3

import requests


access_key='key'

secret_access='key'

region = 'region'

s3 = boto3.client('s3', region_name=region, aws_access_key_id=access_key,

                                   aws_secret_access_key=secret_access)

 

s3.upload_file('source','bucket','destination/filename')

print("uploaded")


No comments:

Post a Comment