Integration of Rich File Manager with ckeditor

This article is helpful to those developers or programmers who are facing the issues with file upload functionality and are using the ckfinder a paid service. Rich file manager is open source and is free to use. You can follow the below steps to integrate this with ckeditor in your spring boot or java application.

1.Download the latest version of ckeditor  and rich file manager. Add the above downloaded files under resources folder of your project. Make sure to add ckeditor and RichFilemanager-master directories in parallel under resource folder.

2.Open the js file /Resources/ckeditor/config.js and add below lines,

config.filebrowserImageBrowseUrl =’/RichFilemanager-master/index.html?filter=image’

(Note, we have added the filter Image to support the upload of images only moreover you can remove or modify the filter as per your need.

3. Enabling the java connector – We need to use the java connector to connect rich file manager with ckeditor.

i) Modify the rich file manager config file available under directory /resources/RichFilemanager-master/config/filemanager-config.json as below

and

ii) Copy the code of java connector (resources\RichFilemanager-master\connectors\java) to standalone java project and generate a jar and add back to class path of your project. Here before generating this jar, you might need to modify/tweak below things in this java connector,
1. Modify the image upload directory path and other configuration in file <filemanager.config.properties> .
2. Add the jar <imgscalr-lib-4.2.jar>,<javax.servlet-api-3.0.1.jar> and <slf4j-api-1.7.21.jar> to your java project which is needed to compile this connector
3. Update the file <AbstractFileManager.java> for below method which is having small bug in current code,

4. Add below method to end of the file <LocalFileManager.java> and use below method to get the file name inside method <uploadFiles> .

String submittedFileName = getFileName(uploadedFile);

In spring boot application, you can declare the jar dependency as mentioned below,

 

iii). Add a controller if you are using spring project as below which will process the file manager request and send the request to Local file manager class available in java connector.

Thanks

One thought on “Integration of Rich File Manager with ckeditor

  1. Kartikaya Joshi says:

    Thanks for the fruitful article. But i am unable to locate “fm-connector.jar”. Please let me know, where can i found it. Please share the jar or jar location or url.

    I have been stuck over this point. Please share it ASAP.

Leave a Reply

Your email address will not be published. Required fields are marked *