Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AllBuckets/temp/test1/t1.txt
- AllBuckets/temp/test1/t2.gz
- def lambda_handler(event, context):
- bucket = event['Records'][0]['s3']['bucket']['name']
- key = urllib.unquote_plus(event['Records'][0]['s3']['object']['key'].encode('utf8'))
- try:
- response = s3.get_object(Bucket=bucket, Key=key)
- if [ response == "t1.txt"]
- print("CONTENT TYPE: " + response['ContentType'])
- return response['ContentType']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement