简体   繁体   English

Ckeditor 图像上传工作,但说它没有(使用 ckfinder)

[英]Ckeditor image upload working, but saying it doesn't (using ckfinder)

I'm using ckeditor on my website (PHP,HTML,JavaScript), and I'd like my users to be able to upload image through the editor, but when I try to do it, the image appears like it's supposed to, then I get an error message in a pop-up saying the image couldn't be uploaded, when I click on the pop-up the image disappear.我在我的网站(PHP,HTML,JavaScript)上使用 ckeditor,我希望我的用户能够通过编辑器上传图像,但是当我尝试这样做时,图像看起来应该是这样,然后我在弹出窗口中收到一条错误消息,说图像无法上传,当我单击弹出窗口时,图像消失了。 The weird thing is that the image does get uploaded successfully in the right folder...奇怪的是图像确实在正确的文件夹中成功上传......

Anyone got any idea on how I could fix this?有人知道我该如何解决这个问题吗?

I don't really know what part of my code I should share, so feel free to ask me.我真的不知道我应该分享我的代码的哪一部分,所以请随时问我。

The problem was inside the script to create the editor:问题出在创建编辑器的脚本内部:

ClassicEditor.create( document.querySelector( '#editor' ), {
  ckfinder: {
        uploadUrl: '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images'
    },

it seems that ckfinder doesn't automatically return a response to let the editor know the file successfully uploaded, so i had to change it to this:似乎 ckfinder 不会自动返回响应让编辑器知道文件已成功上传,所以我不得不将其更改为:

ClassicEditor.create( document.querySelector( '#editor' ), {
  ckfinder: {
        uploadUrl: '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images&responseType=json'
    },

My bad for not reading the docs correctly我不正确阅读文档很糟糕

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM