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

170
Visualizações
Check file content compared to file type

I would like to check a file (or several) whether they really are the files that have been specified with the extension . E.g. .pdf does not contain .exe content.

I don't want a PDF file to contain executable code and only use the pdf extension. In x++ I validated for certain file types with reg ex e.g. pdf

Is there a library?

Use Case: I built an extensible control in MS D365 for finance and operations. This is a file drop zone. I have to check these files. I can either do this in my external resources (Json) or in X++ itself. Would prefer X++. I am a beginner in both languages. I have the files in X++ as two strings with the name and the base data. In java script as shown below.

       $(".droparea").on("drop", function (event) {
            event.preventDefault();
            event.stopPropagation();
            var file = event.originalEvent.dataTransfer.files;
            for (let i = 0; i < file.length; i++)
            {
                var fileName = file[i].name;
                var fileBase64 = window.btoa(file[i]);
                var params = { _fileName: fileName, _fileBase64: fileBase64 };
                //send files to x++ Control-Class
                $dyn.callFunction(self.SetFiles, self, params);
            }        
        });
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