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

243
Visualizações
TinyMCE (embedded in Webbrowser .NET control) : can't open a local image

Context:

In a Winform VB.NET application, running on Windows 10, .NET 5.0, I use a TinyMCE embedded in a Webbrowser control to display a WYSIWYG html editor in a form, inspired from this to do it. everything works well so far but I tweak TinyMCE to be able to upload image from local drive following this

Issue:

In this weird embedded TinyMCE, the pop window to add image from local drive opens, the button to browse local directory is there, clickable but do nothing.

Code used: I don't know where the issue is located. VB.NET? JS? Is there some kind of webbrowser limitation? I used Tiny MCE 4.3.4.

Here's the javascript used to init TinyMCE


    <script>
    tinymce.init({
  selector: '#editorcontent',
  plugins: ['autolink link lists charmap hr anchor',
        'searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime nonbreaking',
        'table contextmenu directionality paste textcolor',
        'image'],
        setup : function(ed) {
        ed.on('init',function(e) {
            ed.execCommand('mceFullScreen');
        })},
        // enable title field in the Image dialog
        image_title: true, 
        // enable automatic uploads of images represented by blob or data URIs
        automatic_uploads: true,
        // add custom filepicker only to Image dialog
        file_picker_types: 'image',
        file_picker_callback: function(cb, value, meta) {
        var input = document.createElement('input');
        input.setAttribute('type', 'file');
        input.setAttribute('accept', 'image/*');

        input.onchange = function() {
        var file = this.files[0];
        var reader = new FileReader();
      
        reader.onload = function () {
        var id = 'blobid' + (new Date()).getTime();
        var blobCache =  tinymce.activeEditor.editorUpload.blobCache;
        var base64 = reader.result.split(',')[2];
        var blobInfo = blobCache.create(id, file, base64);
        blobCache.add(blobInfo);

        // call the callback and populate the Title field with the file name
        cb(blobInfo.blobUri(), { title: file.name });
        };
        reader.readAsDataURL(file);
        };
        input.click();
        
        }
  }
);

Additionnal infos: The script works like a charm if it's run in Chrome, FF, or Edge. It seems that.NET Webbrowser behave like IE7.

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