I need to retrieve an public object URL directly after uploading a file, this to be able to store it in a database. This is my upload code:
s3 = boto3.res
Just a small note. The function call
location =
boto3.client('s3').get_bucket_location(Bucket=bucket_name['LocationConstraint']
may return location = None if the bucket is in the region 'us-east-1'. Therefore, I'd amend the above answer and add a line below that line:
if location == None: location = 'us-east-1'