The URL <file name> is invalid error message when you upload a file to a SharePoint Online List

 To Resolve the issue, please follow the below steps.
  1. Navigate to the list where the issue exists.
  2. In the ribbon, click the Library tab, and then click Library Settings.
  3. In the fields list, click Indexed Columns.
  4. In the Indexed Columns list, click Version.
  5. Click Delete, and then click OK.
  6. Upload any files that you previously experienced the issue with.