Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

172
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda