Added validation to file transfer