CKEditor is a greatly improved version of the famous FCKEditor. The generated source code is clean and well indented, the whole thing loads faster and feels less buggy. It even looks better.

What I really like though, is the new settings that allow for precise definition of what we want to encode or not and how we wish to handled pasted code (expecially coming from Word processors)

CKeditor is a rather recent version and some documentation will surely arrive soon, in the meantime, the file upload isn’t very documented.

Nevertheless, with some Stack Overflow help, it all comes together pretty quickly :

  • enable the file upload in the configuration by adding the following to your configuration file
1
config.filebrowserUploadUrl = '/fckupload';
  • Code your upload method that will be called when the URL defined in the configuration is called upon
  • Then, that’s the undocumented part, in JavaScript, call method required by CKEditor which is sent to you in the URL (below is a PHP example)
1
2
3
4
5
private function upload() {
    // do upload
    // get file Url
    echo '<script type="text/javascript">window.parent.CKEDITOR.tools.callFunction('.$this->getHttpParam("CKEditorFuncNum").', "'.$fileUrl.'");</script>';
}
Filed under: PHP

Tagged with: , ,

Liked this page?

Tweet it

Subscribe to the RSS feed or sign up for the newsletter now.

Posts related to CKEditor, enable the image or flash upload

2 Comments to "CKEditor, enable the image or flash upload"

  1. Trackback on samantha on January 22, 2010 at 5:19 pm

    New blog post: CKEditor, enable the image or flash upload: CKEditor is a greatly improved version of the famous FC… http://bit.ly/4oFX2W

  2. Comment by Michal on May 17, 2011 at 3:34 pm Reply

    Nice image uploader – plugin for CK Editor http://www.ckuploader.com

Name (required)

Email (required)

Website

Leave a Reply