我在我的页面上使用CKeditor但是我的图片上传有问题。我正在尝试使用网站上传的图片。但我得到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>