简体   繁体   中英

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

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. All it requires is the correct config.ckfinder.uploadUrl path. 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:

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

The uploader works fine if I go to the sample page - http://example.com/ckfinder/samples/full-page-open.html

Didn't get this working, so used https://github.com/ckfinder/ckfinder-laravel-package instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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