Check for invalid characters in the file name