ckeditor4文件浏览器上传网址:未添加网址参数

时间:2019-01-21 11:00:33

标签: ckeditor ckeditor4.x

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

CKeditor应该按照以下说明添加一些网址参数:https://ckeditor.com/docs/ckeditor4/latest/guide/dev_file_browser_api.html

  

CKEditor自动将一些其他参数发送到文件   管理员:CKEditor = editor1&CKEditorFuncNum = 1&langCode = zh_CN

版本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>

帮助表示感谢!

1 个答案:

答案 0 :(得分:0)

问题解决了。

CKEditor4需要该选项

config.filebrowserUploadMethod = 'form';