We are trying to take some actions when an image is uploaded.
We are following this guide: https://www.david-tec.com/2017/02/using-tinypng-to-automatically-compress-images-in-episerver/
The idea is an initialization module that hooks into the CreatedContent event.
It works perfectly for new images.
But if the image has the same name (for example, we made some changes locally and want to re-upload with the same name) then the event is not triggering.
Does anyone know a way around this?
CreatedContent is only triggered when created, so the first time indeed. Maybe the way Vafan did it is a better way for you? See the first comment on the article you mentioned.