Answers for "s3 upload file from url boto3"

1

boto3 upload file to s3

import boto3
s3 = boto3.resource('s3')
s3.meta.client.upload_file('/tmp/hello.txt', 'mybucket', 'hello.txt')
Posted by: Guest on June-24-2020
0

how to know url after upload in s3 using boto3

bucket_location = boto3.client('s3').get_bucket_location(Bucket=s3_bucket_name)
object_url = "https://s3-{0}.amazonaws.com/{1}/{2}".format(
    bucket_location['LocationConstraint'],
    s3_bucket_name,
    key_name)
Posted by: Guest on December-29-2020

Python Answers by Framework

Browse Popular Code Answers by Language