Strapi upload S3 and cloudinary

How can I use both services at the same time?

The photos I want to upload to cloudinary
A large file and a different photo format to upload to Amazon S3

I would guess you can extend the functionality of an upload function, by creating your own.
Then as an example check the size of the file that is incoming. Then decide if it should be uploaded to cloudinary or S3 etc.

Do you have any idea where I can find an example or guidance on how I can do it? Currently reviewing official documentation, but I find it difficult to correct yet.