Fix #6521 - respect uri.path in upload URLs

`-b` won't work on jenkins :-(