You should be able to identify the filetype by looking at the first few bytes. If they are random the file is just garbage.