通过拖放插入图像时的CKFinder错误的服务器响应

问题描述

我正在尝试将本站点https://ckeditor.com/ckfinder/download/)中的CKFinder 2.6.3与CKEditor一起使用,使用拖放操作时出现错误。它显示“服务器响应不正确。”我可以使用浏览服务器和上载功能,但是拖放是唯一导致错误的东西。

我正在使用CKFinder下载中提供的示例:

<script src="//cdn.ckeditor.com/4.5.6/standard-all/ckeditor.js"></script>
    <script>
        if ( typeof CKEDITOR !== 'undefined' ) {
            CKEDITOR.addCss( 'img {max-width:100%; height: auto;}' );
            var editor = CKEDITOR.replace( 'editor1',{
                extraPlugins: 'uploadimage,image2',removePlugins: 'image',height:350
            } );

            CKFinder.setupCKEditor( editor,'../' ) ;

        } else {
            document.getElementById( 'description' ).innerHTML = '<div class="tip-a tip-a-alert">This sample requires working Internet connection to load CKEditor from CDN.</div>'
        }
    </script>

在控制台中,它说:

ckeditor.js:19 [CKEDITOR] Error code: filetools-response-error. 
{responseText: "//{"uploaded":1,"error":{"message":"A file with th…ncements\/images\/2367_093051_750_589115(1).jpg"}"}
responseText: "//{"uploaded":1,"error":{"message":"A file with the same name is already available. The uploaded file was renamed to \"2367_093051_750_589115(1).jpg\".","number":201},"fileName":"2367_093051_750_589115(1).jpg","url":"\/pictures\/Announcements\/images\/2367_093051_750_589115(1).jpg"}"
__proto__: Object

我读过一些帖子,您必须指定responseType = json,但不确定将其放在何处。

解决方法

对于可能遇到此问题的任何人。 RRK指出,Coldfusion Administrator中有一个选项用于“使用//前缀序列化JSON”。我取消选中此选项,它为我解决了这个问题。