If your FTP upload does not work and you get the error that it has an invalid filename, make sure you have a leading / in your filepath. Otherwise your FTP server might think that the uploaded file has a / within the name.

Path: livescore/basketball + Filename: game.php
...would lead to livescore/basketball/game.php which is recognized as a filename with incorrect / character

Correct with leading /:
Path: /livescore/basketball + Filename: game.php
...would lead to a correct /livescore/basketball/game.php