CKFinder when inserting images via drag and drop (Incorrect server response)

544 Views Asked by At

I'm trying to use CKFinder 2.6.3 from this site (https://ckeditor.com/ckfinder/download/) with CKEditor and I'm getting an error when using drag and drop. It says "Incorrect server response." I can use the Browse Server and the upload functions but the drag and drop is the only thing giving the error.

I am using the example that was provided in the CKFinder download:

<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>

In the console, it says:

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

I have read in some posts that you have to specify responseType=json but I'm not sure where to put that.

1

There are 1 best solutions below

0
On

For anyone who might be having this issue. RRK pointed out that there is an option in the Coldfusion Administrator for "Prefix serialized JSON with //". I unchecked this option and it resolved the issue for me.