Serverless File Uploader with AWS HTTP Gateway and S3 - Step by Step Tutorial

  Рет қаралды 5,482

Knowledge Amplifier

Knowledge Amplifier

Күн бұрын

Lambda Code:
------------------------
import json
import base64
import boto3
client=boto3.client('s3')
def lambda_handler(event, context):
TODO implement
print(event)
ms=base64.b64decode(event['body'])
response = client.put_object(
Body=ms,
Bucket='demouploadfromapilambda',
Key='test1.PNG',
)
print(response)
return {
'statusCode': 200,
'body': json.dumps('Image uploaded successfully')
}
Check this playlist for more AWS Projects in Big Data domain:
• Demystifying Data Engi...

Пікірлер: 14
@kaancukur5312
@kaancukur5312 11 ай бұрын
Thanks bro, you r best amk
@KnowledgeAmplifier1
@KnowledgeAmplifier1 11 ай бұрын
You are welcome buddy 😊 Happy Learning ✌🏻
@manojt7012
@manojt7012 2 жыл бұрын
Hi. I was able to successfully upload to S3 but when I download the PNG it is not opening saying as unsupported format
@KnowledgeAmplifier1
@KnowledgeAmplifier1 2 жыл бұрын
are you uploading jpg file and saving as .png or something ? I mean have you given proper format ?
@manojt7012
@manojt7012 2 жыл бұрын
@@KnowledgeAmplifier1 yeah I'm uploading .png and saving the key in same .png only but not sure why it is not opening
@manojt7012
@manojt7012 2 жыл бұрын
@@KnowledgeAmplifier1 hey sorry I made some mistake in code. Now I have resolved that.. thanks bro
@KnowledgeAmplifier1
@KnowledgeAmplifier1 2 жыл бұрын
@@manojt7012 super , Glad to know it's resolved ! Happy Learning :-)
@gauravjoshi2982
@gauravjoshi2982 2 жыл бұрын
@@manojt7012 hey, I have same problem. so, can you explain me what you did? I'm uploading .jpg file and .png file successfully but when i download from s3 bucket it's not accessible.
@prateekranjan8085
@prateekranjan8085 Жыл бұрын
Thanks bro, for making it easy!
@KnowledgeAmplifier1
@KnowledgeAmplifier1 Жыл бұрын
Any time!
@madhubhardwaj4512
@madhubhardwaj4512 Жыл бұрын
Hi Dear, Here Image file name is hard coded. how we can make it dynamic as I don't see any key holding filename. Thanks
@jitxhere
@jitxhere Жыл бұрын
You can read image file name Or you many people prefer random image name from uuid or nanoid
@mohammedabu-o4f
@mohammedabu-o4f Жыл бұрын
simply fabulous
@KnowledgeAmplifier1
@KnowledgeAmplifier1 Жыл бұрын
Thank you so much for your kind words Mohammed Abu! Happy Learning
Downloading images form AWS S3 via Lambda and API Gateway
18:46
Knowledge Amplifier
Рет қаралды 7 М.
Tutorial: How to upload files into a S3 Bucket using a REST API via API Gateway
12:34
Which One Is The Best - From Small To Giant #katebrush #shorts
00:17
Help Me Celebrate! 😍🙏
00:35
Alan Chikin Chow
Рет қаралды 56 МЛН
Worst flight ever
00:55
Adam W
Рет қаралды 29 МЛН
Build a HTTP API using AWS Lambda and API Gateway
24:21
Jonathan Davies
Рет қаралды 16 М.
Webhooks Processing: HTTP API Gateway + SQS +Lambda
13:02
Alex Rusin
Рет қаралды 16 М.
How to Use AWS S3 with NodeJS?
30:39
Piyush Garg
Рет қаралды 49 М.
Building a Serverless REST API in .NET with AWS Lambda
20:13
Nick Chapsas
Рет қаралды 77 М.
Upload files to S3 using API Gateway - Step by Step Tutorial
10:53
Enrico Portolan
Рет қаралды 60 М.
Which One Is The Best - From Small To Giant #katebrush #shorts
00:17