admin管理员组

文章数量:1323519

I have been seeking for any thread with the related issue, but couldn't find one, I'm trying to set an image upload for ckeditor5-react, picking up a file via file browser works fine but I get an alert "cannot upload file"

Here is my code below:

<CKEditor
    editor={ ClassicEditor } 
    onChange={ ( event, editor ) => console.log( { event, editor } ) }
    config={{
         ckfinder:{uploadUrl: "/uplaodImageFromEditor"}
      }}
    UploadAdapter={FileRepository}
 />

I have been seeking for any thread with the related issue, but couldn't find one, I'm trying to set an image upload for ckeditor5-react, picking up a file via file browser works fine but I get an alert "cannot upload file"

Here is my code below:

<CKEditor
    editor={ ClassicEditor } 
    onChange={ ( event, editor ) => console.log( { event, editor } ) }
    config={{
         ckfinder:{uploadUrl: "/uplaodImageFromEditor"}
      }}
    UploadAdapter={FileRepository}
 />
Share Improve this question edited Sep 22, 2018 at 14:29 Maciej Bukowski 3,34825 silver badges28 bronze badges asked Jul 31, 2018 at 7:19 SonkeSonke 351 gold badge2 silver badges9 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 4

First of all, there's no UploadAdapter property available in the CKEditor ponent.

Secondly, the image feature is based on the image upload, so you need to configure your backend, so the uploaded images can be stored somewhere. As it's explained in the How to enable image upload support in CKEditor 5?, so you have a few options.

If you want to use the CKFinder, then you need to install the CKFinder and provide a correct URL in the ckfinder.uploadUrl config. Eventually, you can use this URL as the endpoint for your own backend - see how the backend responses should look like for the ckfinder.uploadUrl config.

本文标签: javascriptImage Upload in ckeditor5reactStack Overflow