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

278
Visualizações
Copy mail from Outlook and paste msg-file to file input


Copying different files into the input such as xlxs, png, msg, etc. works perfectly. What I wish to accomplish is being able to copy mails directly from Outlook into the input (as msg-files).

The problem:

If I copy a mail from Outlook with the current solution I get vague information such as the subject, sent date, receiver etc - Just as if you would paste the clipboard into notepad.

The Goal:

If you copy a mail from Outlook into a word document for example, it creates a clickable msg-file. This is the file I'd like to paste into my input.

Right now, I've to copy the mail from Outlook, paste it into word, copy it again, to finally being able to paste the msg-file into the input

HTML:

<div id="documentUploadDiv">
  <div id="filedataholder" filebase64data="" hasfile="false"></div>
  <div id="filereaderdialog_filegroup">
    <input type="file" id="filedatareader_filegroup">
  </div>
</div>

Script:

window.addEventListener('paste', e => {
try{          
    $('#filedatareader_filegroup').get(0).files = e.clipboardData.files;
    $('#filedatareader_filegroup').trigger("change");

    var reader = new FileReader();
    reader.readAsDataURL(e.clipboardData.files[0]);

    $("#filedataholder").attr("filebase64data", reader.result) 
  
    }catch(e){
        console.error(e)
    }
});
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

That is because Outlook copies its message in multiple clipboard formats, but FileContents/Filename are not available since there is no real file on the file system.

See Upload fails when user drags and drops attachment from email client for a similar issue.

enter image description here

about 4 years ago · Juan Pablo Isaza Relatório
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