If you are OK with writing a Lambda you could do this:
- Send smaller chunks from ESP32 to a temp location, using a part naming scheme, e.g. instead of writing to “images/myimg.jpg” you write to “tmp_images/myimg.jpg.1_5.part” (1 is the part, 5 is the total parts expected)
- Set up an S3 trigger to Lambda when writing anything matching “*.part” (suffix), which would check if all parts are uploaded yet or not, and if they are combine them and write “images/myimg.jpg” (and remove the old parts)
The reason to add “.part” is so your S3 trigger can filter to only react to those specific writes, and not all writes of the S3 bucket.