First, If you want to upload a flat binary, it needs to be converted to an ELF first. In order to do that, use this script: https://gist.github.com/pavel-kirienko/6835194423df07f6160af19f7ea33a4d
Now you have your ELF. To upload it, start a GDB client and pass the path to the ELF as a command line argument. For example:
...