CKEditor 4.x 批量图片上传插件

CKEditor 4.x 批量图片上传插件

插件仓库
GitHub - prosaically/CKEditor-uploads: CKeditor 4.x 批量图片上传插件。CKeditor 4.x Batch Picture Upload Plug-in.CKeditor 4.x 批量图片上传插件。CKeditor 4.x Batch Picture Upload Plug-in. - GitHub - prosaically/CKEditor-uploads: CKeditor 4.x 批量图片上传插件。CKeditor 4.x Batch Picture Upload Plug-in.https://github.com/prosaically/CKEditor-uploads

觉得可以的话,记得点个星喔。

以下图片为效果图

使用流程

  1. 下载CKEditor 4.x
  2. 配置插件
    • 将 uploads 插件复制到 CKEditor 目录下的 plugins 目录。
    • 在 CKEditor 目录的 config.js 中启动插件。
    • 在 CKEditor 目录的 config.js 中配置图片上传URL。 

 参考配置

CKEDITOR.editorConfig = function(config) {

  // 启用插件
  config.extraPlugins = 'uploads';
  
  // 上传URL,该 URL 规范遵循 CKEditor 图片上传规范
  config.filebrowserBrowseUrl = 'http://127.0.0.1:8110/system/upload';
  config.filebrowserUploadUrl = 'http://127.0.0.1:8110/system/upload';
  
  // CKEditor图片上传接口返回格式
  /*
  成功返回:
  {
    "fileName": "8S[TBUTHJ5EXE}2F5LBE1]D.png",
    "uploaded": 1,
    "url": "https://ckeditor.com/apps/ckfinder/userfiles/images/8S%5BTBUTHJ5EXE%7D2F5LBE1%5DD.png"
  }	
  失败返回:
  {
    "uploaded": 0,
    "error": {
      "message": "失败原因"
    }
  }
  */
  
};

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值