Why am I getting a File type error when I meet the file type requirements?