php - How to upload video from local pc in ckeditor? -
please advice me how upload video(.flv,mp3,etc) in ckeditor using ckfinder in php.
if have demo please provide link.
instead of ckfinder if have better option(plug in), please give me demo link , advice me how integrate?
thanks
you have set few parameters in ckeditor config point uploading script:
filebrowserbrowseurl: "index.php?route=filemanager/index", filebrowserimagebrowseurl: "index.php?route=filemanager/index", filebrowserflashbrowseurl: "index.php?route=filemanager/index", filebrowseruploadurl: "index.php?route=filemanager/index", filebrowserimageuploadurl: "index.php?route=filemanager/index", filebrowserflashuploadurl: "index.php?route=filemanager/index"
and in php file save file:
public function index() { $file = !empty($_files['upload']) ? $_files['upload'] : null; $fileurl = ''; if (!empty($file) && !empty($_get['ckeditor']) && !empty($_get['ckeditorfuncnum'])) { if (!move_uploaded_file($file["tmp_name"], $targetfile)) { $error = 'failed upload file.'; } else { $fileurl = "http://example.com/uploads/file_name.png"; } } else { $error = 'not authorized'; } echo <<<js <script type="text/javascript"> window.parent.ckeditor.tools.callfunction({$_get['ckeditorfuncnum']}, '{$fileurl}', '{$error}'); </script> js; }
Comments
Post a Comment