Jan
22
CKEditor, enable the image or flash upload
January 22, 2010 | 2 Comments
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: ckeditor, PHP, upload
Liked this page?
Tweet it
Tweet
Subscribe to the RSS feed or sign up for the newsletter now.
New blog post: CKEditor, enable the image or flash upload: CKEditor is a greatly improved version of the famous FC… http://bit.ly/4oFX2W
Nice image uploader – plugin for CK Editor http://www.ckuploader.com