Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

172
Visualizações
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

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda