'how to enable image upload in ckeditor5
The situation is as follows:
I have created a custom build of ckeditor5 through Online builder and I have added imageupload plugin.
The configuration in the html file is as follows:
<script>
const watchdog = new CKSource.EditorWatchdog();
window.watchdog = watchdog;
watchdog.setCreator((element,config)=>
{
return CKSource.Editor.create(element,config).then(editor=>
{
return editor;
})
});
watchdog.setDestructor(editor=>{return editor.destroy();});
watchdog.on('error',handleError);
watchdog.create(document.querySelector('#editor1'),
{
language: 'el',
licenseKey: '',
}).catch(handleError);
watchdog.create( document.querySelector('#editor2'),
{
language: 'en',
licenseKey: '',
}).catch(handleError);
function handleError(error)
{
console.error( 'Oops, something went wrong!' );
console.error( 'Please, report the following error on https://github.com/ckeditor/ckeditor5/issues with the build id and the error stack trace:' );
console.warn( 'Build id: q026q39lsmvc-vna1sf15668n' );
console.error( error );
}
</script>
The configuration in cheditor.js is the following:
F$.builtinPlugins = [jy, Lx, eS, cT, ST, PT, JT, dI, FI, yB, qI, VB, fM, RM, HM, JM, kN, LN, JN, uz, vz, yz, Rz, hP, yP, AL, PL, mR, gR, aL, CR, ER, MR, uO, _O, cV, XV, Nj, zj, jN, kF, vF, zF, eH, nH, iH, aH, rH, oH, sH, mH, wH, xH, uq, Eq, QG, y$, x$, _x, B$, N$];
F$.defaultConfig = {
toolbar: {
items: ["heading", "|", "undo", "redo", "|", "fontFamily", "fontSize", "fontColor", "fontBackgroundColor", "highlight", "|", "bold", "italic", "underline", "strikethrough", "superscript", "subscript", "horizontalLine", "link", "-", "code", "codeBlock", "blockQuote", "|", "alignment", "insertTable", "outdent", "indent", "numberedList", "bulletedList", "|", "imageInsert", "mediaEmbed", "|", "htmlEmbed", "specialCharacters", "|", "findAndReplace", "sourceEditing", "removeFormat"],
shouldNotGroupWhenFull: true
},
language: "el",
image: {
toolbar: ["imageTextAlternative", "imageStyle:inline", "imageStyle:block", "imageStyle:side", "linkImage"]
},
table: {
contentToolbar: ["tableColumn", "tableRow", "mergeTableCells", "tableCellProperties", "tableProperties"]
}
};
When I try to upload an image with drag and drop or by clicking on the respective button I get the following error:
filerepository-no-upload-adapter
Read more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-filerepository-no-upload-adapter
I tried to follow the instructions in the above url but with no luck.
All I am trying to do is have an image handler similar to the one that is shown on the following page:
https://ckeditor.com/docs/ckeditor5/latest/features/images/images-overview.html#demo
Any ideas?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
