CKeditor文件上传错误上传

时间:2018-05-23 09:23:22

标签: php html ckeditor

我在我的页面上使用CKeditor但是我的图片上传有问题。我正在尝试使用enter image description here网站上传的图片。但我得到this作为文件上传者而不是另一个。

我的代码是:

CKEDITOR.editorConfig = function( config ) {
    config.filebrowserUploadUrl = '/uploader/upload.php';
    config.toolbar = [
        { name: 'insert', items: ['Smiley'] },
        { name: 'basicstyles', items: [ 'Bold', 'Italic', 'Underline' ] },
        { name: 'links', items: [ 'Image' ]  }          
    ];

    config.autoParagraph = false;
    config.allowedContent = true;
    config.fullPage = false;    
    config.extraAllowedContent = 'p(*)[*]{*};span(*)[*]{*};div(*)[*]{*};li(*)[*]{*};ul(*)[*]{*}';

    config.extraPlugins = 'youtube,ckawesome';
    config.fontawesomePath = 'https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css';

    config.contentsCss = ['https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css','https://app.gratiswebshopbeginnen.nl/assets/bootstrap/css/bootstrap.min.css'];

    // Se the most common block elements.
    config.format_tags = 'p;h1;h2;h3;pre';

    // Make dialogs simpler.
    //config.removeDialogTabs = 'image:advanced;link:advanced';
};

php文件中的脚本:

<script type="text/javascript" src="/assets/plugins/ckeditor/ckeditor.js"></script>
            <script>CKEDITOR.dtd.$removeEmpty['span'] = false; CKEDITOR.dtd.$removeEmpty['i'] = false;</script>
            <script>CKEDITOR.env.isCompatible = true;</script>

            <script type="text/javascript">
            CKEDITOR.replace( 'editor1',
            {
                customConfig: '/assets/plugins/ckeditor/config.js',
                filebrowserBrowseUrl : '/assets/plugins/ckeditor/plugins/browser/browse.php',
                enterMode : CKEDITOR.ENTER_BR
            });
            </script>  

2 个答案:

答案 0 :(得分:0)

从您附加的图片中,看起来您为CKEditor获得了正确的插件。唯一的区别是语言,并且您的图片有更多“可见”标签,因为一些标签只有在ckeditor / config.js文件中设置了特定设置后才可用。请参阅UploadImage插件演示页面中的此屏幕截图:

enter image description here

那么,您能更具体地了解您的问题或问题吗?

答案 1 :(得分:0)

使用我的github存储库中的插件工作ckeditor /自定义插件