'ckeditor uploadimage plugin base64 not replaced with url

I am using CKEditor for a textarea for a Web Forms web app in .NET C#, and some users paste images inside the textarea, that results in lot of informations saved, that sometmes generates loading error, because of the length of the base64 content of the image. So I am trying to use the uploadimage CKEditor plugin Here I configured the plugin in the editor configuration in my script

var edit1 = CKEDITOR.replace('txtDescription',
    {
        language: editorlang,
        customConfig: 'config_basic.js',
        height: '100px',
        extraPlugins: 'uploadimage',
        uploadUrl: 'uploadHandler.ashx?upload_type=ticket_img&codeSiteId=' + $('#hfCODE_SITEID').val()
    });

In the C# method of uploadHandler called, the image is correctly uploaded, but when the method returns, in the editor I always see the base64 string when I look the image properties, and not the generated URL. I saw on the plugin documentation that the server method has to return a JSON, so I tried creating a JSON

string _atchHTML = "{\n " +
"    \"uploaded\": 1,\n" +
"    \"fileName\": \"" + fileName + "\",\n" +
"    \"url\": \"" + src  + "\"\n" +
"}";

but it dosn't work, and from other responses I tried with a javascript function

string _atchHTML = "<script type='text/javascript'>window.parent.CKEDITOR.tools.callFunction("+ IdAttach + ",'" + src + "','" + fileName + "');</script>";

but it still doesn't work, and I see an error in the console browser

Uncaught TypeError: el.find is not a function

What am I doing wrong? Thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source