Reputation: 21
I tried to add custom image upload adapter by following official documentation on ckeditor site, copy from site and paste to my code. My image was success to uploaded. But if I get content from my editor (using editor.getData()), I get this result :
<figure><img></figure>
The img tag haven't any attribute, even src attribute. So, how to solve this? My code exact like the code in documentation (in the end section)
https://ckeditor.com/docs/ckeditor5/latest/framework/guides/deep-dive/upload-adapter.html
Upvotes: 1
Views: 937
Reputation: 22023
My guess is – your server does not return the URL in the right format.
Add a console log here:
console.log( response ); // ADDED
// If the upload is successful, resolve the upload promise with an object containing
// at least the "default" URL, pointing to the image on the server.
// This URL will be used to display the image in the content. Learn more in the
// UploadAdapter#upload documentation.
resolve( {
default: response.url
} );
You should see on the console an object with a property url
. If that's not true, then you have to fix your server implementation.
Upvotes: 2