Hi,
How do I validate the size of uploaded image in CK Editor 5? For example, I want to upload an image with maximum size of 5mb.
Thank you.
I had a similar situation, but I did a work around.
My solution was to accept any size but compress the image to the desired limit if the image is bigger than my limit.
Can you briefly explain to me how did you do it because I got your point but I don't know how to implement the logic.
If I recall correctly, the CKEditor uses the UploadScreen to upload the files to the database.
I used a component from the forge to resize the uploaded binary and then store it in the database.
https://www.outsystems.com/forge/component-overview/381/image-utilities
1 - Locate the CkEditor module and find the UploadScreen screen. In the preparation you should find the StoreFile function.
2 - In the StoreFile use the ScaleImage and do some logic determine if the image is too big, and if so resize it and store it with your max size.
The following prints are just to show how the CkEditor actually gets to the UploadSCreen:
Thank you for your help. I will try to implement it in my logic.