If you're building a Node.js upload endpoint, you shouldn't have to implement every file-security check yourself.
I built filebouncer, a node file security library that detects MIME mismatches, polyglot files, unsafe archive paths, archive size issues.