I'm planning to use this system program /usr/bin/file to determine uploaded file content type and then act accordingly.
Is this a good idea or are there things I should watch out for? (Or use something altogether different)
PHP has the fileinfo extension, which uses the same mechanism but is native to PHP.