Added detection of valid/invalid pdf content on upload.