0

CKEditor: limit image size

asked 2021-11-30 16:11:18 +0800

softteam gravatar image softteam
130 8

Hi,

Is there any way to limit the image size in CKEditor 4?

Thank you, Javier

delete flag offensive retag edit

1 Answer

Sort by » oldest newest most voted
0

answered 2021-12-06 17:55:35 +0800

hawk gravatar image hawk
2941 1 5
http://hawkphoenix.blogsp... ZK Team

updated 2021-12-06 18:44:04 +0800

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.

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2021-11-30 16:11:18 +0800

Seen: 5 times

Last updated: Dec 06 '21

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More