简体   繁体   English

CKEditor5 和 CKFinder

[英]CkEditor5 and CKFinder

Really basic question I hope.我希望这是一个非常基本的问题。

I keep getting a 'no upload adapter' error message in the console when I try to add an image using CKeditor 5 - Read more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-filerepository-no-upload-adapter当我尝试使用 CKeditor 5 添加图像时,控制台中不断收到“无上传适配器”错误消息 - 阅读更多: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error- code.html#error-filerepository-no-upload-adapter

Below are the instructions from the documentation.以下是文档中的说明。

Configuring the image upload only This feature can upload images automatically to the server (eg when the image is dropped into the content) thanks to the CKFinder upload adapter.仅配置图片上传 借助 CKFinder 上传适配器,此功能可以自动将图片上传到服务器(例如,当图片被放入内容中时)。 All it requires is the correct config.ckfinder.uploadUrl path.它只需要正确的 config.ckfinder.uploadUrl 路径。 Assuming that the CKFinder PHP server-side connector is installed (available) under https://example.com/ckfinder/ , use the following quick upload command URL to enable the image upload:假设在https://example.com/ckfinder/下安装(可用)CKFinder PHP 服务器端连接器,请使用以下快速上传命令 ZE6B391A8D2C4D45902A23A8B6Z58 启用图像上传:

import CKFinder from '@ckeditor/ckeditor5-ckfinder/src/ckfinder';

ClassicEditor
    .create( document.querySelector( '#editor' ), {
        plugins: [ CKFinder, ... ],

        // Enable the "Insert image" button in the toolbar.
        toolbar: [ 'uploadImage', ... ],

        ckfinder: {
            // Upload the images to the server using the CKFinder QuickUpload command.
           uploadUrl: 'https://example.com/ckfinder/core/connector/php/connector.php? command=QuickUpload&type=Images&responseType=json'
        }
    } )
    .then( ... )
    .catch( ... );

I have added the above code onto the webpage where my editor exists within tags.我已将上述代码添加到我的编辑器存在于标签中的网页上。 Am I doing this wrong?我做错了吗? Should this code be added somewhere else, within the config file somewhere else I am missing?是否应该将此代码添加到其他地方,在我缺少的其他地方的配置文件中?

Link to the documentation in question - https://ckeditor.com/docs/ckeditor5/latest/features/image-upload/ckfinder.html链接到相关文档 - https://ckeditor.com/docs/ckeditor5/latest/features/image-upload/ckfinder.html

The uploader works fine if I go to the sample page - http://example.com/ckfinder/samples/full-page-open.html如果我将 go 转到示例页面 - http://example.com/ckfinder/samples/full-page-open.html ,则上传程序工作正常

Didn't get this working, so used https://github.com/ckfinder/ckfinder-laravel-package instead.没有得到这个工作,所以使用https://github.com/ckfinder/ckfinder-laravel-package代替。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM