Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to validate a file on S3 send by pre-signed URL?

I understand that a pre-signed URL is a way to send a file to S3. By doing that way, how can the object be validated? For example, I want to submit a JSON file to S3 and I want to make sure the file is in a correct format as input. I'd like to know if there is any way to make a response that the file is correctly saved and is valid by own validator function.

like image 301
andrewshih Avatar asked Oct 15 '25 07:10

andrewshih


1 Answers

You could have an S3 event for create object that triggers a Lambda function. This could perform the validation checks you desire.

See: https://docs.aws.amazon.com/lambda/latest/dg/with-s3.html

like image 116
Chris Williams Avatar answered Oct 17 '25 00:10

Chris Williams