【问题标题】:ckeditor4 filebrowser upload url: url params are not addedckeditor4 文件浏览器上传 url:不添加 url 参数
【发布时间】:2019-02-03 18:16:45
【问题描述】:

我从版本 3 升级到 CKeditor4。遗憾的是,我的文件和图像上传集成不再起作用。

CKeditor 应该添加一些 url 参数,如下所述:https://ckeditor.com/docs/ckeditor4/latest/guide/dev_file_browser_api.html

CKEditor 自动向文件发送一些附加参数 经理:CKEditor=editor1&CKEditorFuncNum=1&langCode=en

第 4 版不会发生这种情况。

这是一个带有复制说明的小提琴: https://jsfiddle.net/5wzh9a08/1/

<html lang="de">
<head>

<meta charset="utf-8" />

<script src="https://cdn.ckeditor.com/4.11.2/standard/ckeditor.js"></script>

</head>

<body>

<h1>
CKeditor 4 upload problem
</h1>

<p>
Problem: CKeditor 4 does not append "CKEditor=editor1&CKEditorFuncNum=1&langCode=en" to the upload URL.
</p>
<p>
How to reproduce:
</p>
<ul>
<li>Open web developer console in browser</li>
<li>Click (and enable) network tab</li>
<li>In CKeditor: click on image icon</li>
<li>Click "upload", select a file and click "Send to server"</li>
<li>Watch the request in web developer console: the necessary url params are not added.</li>
</ul>
<p>
Reference: <a href="https://ckeditor.com/docs/ckeditor4/latest/guide/dev_file_browser_api.html">https://ckeditor.com/docs/ckeditor4/latest/guide/dev_file_browser_api.html</a>
</p>

<textarea name="editor1" id="editor1" rows="8" cols="80">
  test 123
</textarea>

<script type="text/javascript">
  CKEDITOR.replace( 'editor1', {
    filebrowserImageUploadUrl: '/upload.html',
  });
</script>

</body>
</html>

帮助表示赞赏!

【问题讨论】:

    标签: ckeditor ckeditor4.x


    【解决方案1】:

    问题解决了。

    CKEditor4 需要该选项

    config.filebrowserUploadMethod = 'form';
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-14
      相关资源
      最近更新 更多