I have an application that needs to support uploading of content files such as PDFs, images, etc.
What is the most reliable method of ensuring that I only get the kinds of files I specify, and no other files such as executables? Should I just look at the file extension or content-type, or is there a better way?