How to set multiple form-data to uploadAdapter in ckeditor 5

send an image file to a server through ckeditor upload-adapter but it’s sending empty data to server.

I am using this package in nuxt:

<ckeditor type="classic" v-model="form.description" :upload-adapter="UploadAdapter"></ckeditor>
UploadAdapter: function (loader) {
    this.loader = loader
    this.upload = () => {
    const body = new FormData();
    body.append('file', this.loader.file);

    return fetch('http://localhost:8000/api/imageUpload', {
    headers: {
    'Content-Type': "multipart/form-data; charset=utf-8; boundary=" + Math.random().toString().substr(2),
    'Accept': 'application/json'
           },
    body: body,
    method: 'post'
            })
    .then(response => response.json())
    .then(downloadUrl => {
          return {

        default: downloadUrl
        }
    })
    .catch(error => {
        console.log(error);
    });
        }
    this.abort = () => {
          console.log('Abort upload.')
    }

}

when I click for image upload it’s trigger UploadAdapter methods and try to send to the server but it’s sending only an empty form.

becase

this.loader.file

is

Promise

so you should make like this image