Raise error for invalid file names