How to validate the corrupted files

Hi Experts,

I am getting my inputs from FTP, suppose there are 20 files in Ftp out of them 5 got corrupted then then how do we validate those files before sending it to the input.

For our input file we define a schema, if that schema matches with the Canonical Document then it doesn’t throws any error or else we get error. So before sending those files in the FTP as input how do we validate those corrupted files.