Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

168
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!