RE: How catch image upload event (document library) and create copy of it?

Nikita Laitinen, modified 5 Years ago. Junior Member Posts: 44 Join Date: 12/18/19 Recent Posts
Hello!
How to be with the following idea?
When user upload a new image into the document library I want automatically create copies of the original one, but with different sizes
I don't know in what direction to go to achieve it
Could someone help me, please?

I guess I have to catch image upload event, do some logic to create new images, save them and continue the original action
But I have zero ideas about how this module should look, do I need to override some service? if yes, which one? Any other advice
​​​​​​​Thanks a lot in advance
thumbnail
Mohammed Yasin, modified 5 Years ago. Liferay Master Posts: 593 Join Date: 8/8/14 Recent Posts
Hi ,
You can write  Liferay Service Wrapper  for DLAppService , whenever an image is uploaded it will call its respected method and  you can write your custom logic for creating images of diff sizes inside it.
You can refer below link for creating service wrapper
https://help.liferay.com/hc/en-us/articles/360018159951-Overriding-Liferay-Services-Service-Wrappers-
Nikita Laitinen, modified 5 Years ago. Junior Member Posts: 44 Join Date: 12/18/19 Recent Posts
I got the idea. Thank you!