Reputation: 389
I would like to upload image files to AWS S3 bucket which triggers a Lambda function that modify the images, using python boto3
library and presigned URLs.
And I would like to implement the following rules:
Currently my codes and settings are as follows:
[Python codes]
boto3.client('s3', ...).generate_presigned_post(...,
Key='userupload/' + key,
Fields={
"Content-Type": "image/jpeg",
},
Conditions=[
["starts-with", "$Content-Type", "image/"],
]
)
[Lambda settings]
But, when I try to upload an jpeg file, the file is successfully uploaded to the expected S3 bucket (in userupload
folder), while the Lambda function is not triggered.
I also found that the uploaded object doesn't have the standard "Type" value, while it has the following Metadata:
Are there any good ways to obtain the expected behavior?
Thank you very much for your helps in advance!
Upvotes: 0
Views: 777
Reputation: 26
For the lambda trigger you should considerer this:
Upvotes: 0