I would like to know if there is a way to pass an image file from the client and send it to AWS lambda function. I ask this because I have to save the image file in a S3 bucket but I want to rename and compress the file in the lambda function before uploading it. If it's not possible give me your suggestion.
It is possible. Save the image (PutObject) in a S3 bucket. It is called Push Model where a PutObject in S3 triggers a lambda execution. The S3 object name (key) is passed to the lambda function. The lambda when invoked, downloads the image fie, resizes it and uploads the resized image to a different bucket in S3.
AWS has detailed documentation and example for your use case. Check Using AWS Lambda with Amazon S3 and Tutorial: Using AWS Lambda with Amazon S3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With