0

CKEditor images getting lost when war undeployed from OpenLiberty

asked 2021-05-10 16:02:27 +0800

dgrenier gravatar image dgrenier
0

Hello,

I lost uploaded images when war undeployed from OpenLiberty.

It is possible to upload images outside webapp ? For example, in shared ressources under OpenLiberty.

ZK 9.5.0.2, CKEditor 4.14.0.1.

Regards.

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-05-12 12:18:40 +0800

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

updated 2021-05-13 09:29:57 +0800

By default, it only uploads to a folder inside a web application because a web application can only access the folders under its web context root. When you undeploy a web application, it's expected that the server will remove all its subfolder including your image uploading folder.

To store the uploaded images to a folder out of web context root, you need to implement your own org.zkforge.ckez.CkezFileWriter and assign it by

((CKeditor)comp).setFileWriter(new MyCkezFileWriter("/mydisk/upload"));

Then you might also need a custom image browser template because you need to browse a folder out of web context root. You can reference the default one below to write your own:

ckez-4.14.0.1.jar/web/ckez/html/browse.zul

And specify your template path:

<ckeditor fileBrowserTemplate="fileBrowser.zul"/>

You also need a servlet to handle the image URL after inserting an image.

If you need dedicated support, please contact [email protected]

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-05-10 16:02:27 +0800

Seen: 6 times

Last updated: May 13

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