Program is handling input files from various clients. These files can be sent in via sftp or ftp with files encrypted by gpg.
Files can also be zipped or compressed with gz. Once the files are either unzipped, decompressed or decrypted I'm expecting a plain ASCII text file. I want to ensure the file is valid before moving it off to another program to handle