How to do CKEditor 5 Image Uploading?

Palaniappan RM picture Palaniappan RM · Mar 20, 2018 · Viewed 21.1k times · Source
ClassicEditor
    .create( editorElement, {
        ckfinder: {
            uploadUrl: 'my_server_url'
        }
    } )
    .then( ... )
    .catch( ... );

What should be my server response? I am using Java in the backend. Whatever my response is, it throws a dialog box 'cannot upload file'.

Answer

Ganesh prajapati picture Ganesh prajapati · Apr 14, 2018

Success response :

{
    "uploaded": true,
    "url": "http://127.0.0.1/uploaded-image.jpeg"
}

Failure response :

{
    "uploaded": false,
    "error": {
        "message": "could not upload this image"
    }
}