java ckfinder 图片重命名,CKEditor CKFinder图片上传

本文描述了开发者在PHP5.6环境中集成CKEditor 4.5.2和CKFinder 3.0.0时遇到的问题,主要是在image2对话框中上传功能失效,错误提示为“请求的资源类型无效”。作者详细探讨了配置步骤,包括自定义JS配置和资源类型设置,并寻求解决方案或如何禁用上传选项。
摘要由CSDN通过智能技术生成

我在PHP 5.6上使用CKEditor 4.5.2和CKFinder 3.0.0 . 通常集成工作正常 - 当我单击CKEditor图像按钮时,我可以单击“浏览服务器”按钮并打开CKFinder,我可以选择图像,也可以上传 .

什么不起作用是image2对话框中的“上传”标签 . 我总是收到错误消息“请求的资源类型无效” . 当我点击“发送到服务器”按钮 .

在我的CKFinder配置中,我定义了两种名为 Images 和 Library 的资源类型;除了 Library 是只读的之外,这些基本相同 - 我只想允许上传到 Images 类型 .

有多种方法可以配置CKEditor和CKFinder之间的集成 . 我正在使用CKEditor的自定义JS配置文件,并使用 setupCKEditor 方法将ckFinder连接到它,根据the docs:

CKFinder.setupCKEditor(ckeditor_1, {

'height': '100%',

'jquery': '/js/jquery-1.11.3.min.js',

'skin': 'jquery-mobile',

'swatch': 'a',

'themeCSS': '/themes/mytheme.min.css',

'filebrowserBrowseUrl': '/ckfinder/ckfinder.html',

'filebrowserImageBrowseUrl': '/ckfinder/ckfinder.html?Type=Images',

'filebrowserImageUploadUrl': '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images'

}, "Images");

我已经尝试在我的 CKEDITOR.replace 调用中将相同的值传递给CKEditor,并将它们设置在我的外部配置文件中的 config 属性上,但没有任何变化 - 我仍然得到相同的错误 .

我该怎么做?或者,由于CKFinder上传器工作正常,如何在image2对话框中禁用上传选项卡?

更新:这是我目前创建CKEditor和CKFinder实例的代码:

var ckeditor_1 = CKEDITOR.replace('html', {

"baseHref":"http://mysite.mac.local/",

"toolbarStartupExpanded":true,

"extraPlugins":"symbol",

"customConfig":"/js/ckconfig.js"

});

CKFinder.setupCKEditor( ckeditor_1, {

'height': '100%',

'jquery': '/js/jquery-1.11.3.min.js',

'skin': 'jquery-mobile',

'swatch': 'a',

'themeCSS': '/themes/mytheme.min.css'

}, { type: "Images" } );

和我的CKEditor配置文件:

CKEDITOR.editorConfig = function (config) {

// Define changes to default configuration here. For example:

// config.language = 'fr';

// config.uiColor = '#AADC6E';

config.docType = '';

config.toolbarGroups = [

{name: 'document', groups: ['mode', 'document', 'doctools']},

{name: 'clipboard', groups: ['clipboard', 'undo']},

{name: 'editing', groups: ['find', 'selection', 'spellchecker']},

{name: 'links'},

{name: 'insert'},

{name: 'tools'},

{name: 'others'},

'/',

{name: 'basicstyles', groups: ['basicstyles', 'cleanup']},

{name: 'paragraph', groups: ['list', 'indent', 'blocks', 'align']},

{name: 'styles'},

{name: 'colors'},

{name: 'about'},

{name: 'symbol'}

];

config.removePlugins = 'templates,save,specialchar,image,flash,scayt,forms,wsc,print,iframe,pagebreak';

CKEDITOR.plugins.addExternal('symbol', '/ckeditorplugins/symbol/', 'plugin.js');

config.extraPlugins = 'symbol';

config.templates_replaceContent = false;

config.templates_files = [

'/ckeditorplugins/templates/templates.js'

];

config.allowedContent = true;

config.toolbarCanCollapse = true;

config.fullPage = true;

config.skin = 'bootstrapck';

config.height = 400;

config.uiColor = '#f9dda0';

config.autoParagraph = false;

config.enterMode = CKEDITOR.ENTER_BR;

CKEDITOR.on('instanceReady', function (ev) {

ev.editor.dataProcessor.writer.selfClosingEnd = '>';

});

};

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值