Add upload support to the CLI and server.
Merge branch 'upload'