-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
Is there any way to limit the image size in CKEditor 4?
Thank you, Javier
ZK Ckeditor is just a wrapper of CKEditor 4, and CKEditor config doesn't provide options to limit upload file size.
The possible way is to limit it at the server-side. CkezUploadExtension
that handles the upload of an image doesn't implement such a feature, you need to subclass it and override private FileItem parseFileItem(RequestContext request)
and migrate those codes in AuUploader.parseRequest()
that use ItemFactory
. Because ItemFactory
can have a size threshold.
final ItemFactory fty = new ItemFactory(desktop, request, key, sizeThreadHold, repository, dfiFactory);
final ServletFileUpload sfu = new ServletFileUpload(fty);
Then add your custom extension with
DHtmlUpdateServlet.addAuExtension(wapp, "/ckezupload", new MyCkezUploadExtension());
please refer to org.zkforge.ckez.WebAppInit
.
Asked: 2021-11-30 16:11:18 +0800
Seen: 7 times
Last updated: Dec 06 '21