admin管理员组文章数量:1323699
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
1 Answer
Reset to default 4First 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
版权声明:本文标题:javascript - Image Upload in ckeditor5-react - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742133044a2422247.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论