Fixes handling of upload paths
Commit 91d6f0b6 fixes this pull-request
Pull-Request has been merged by mikem
Original issue is #1634
Fixes handling of upload paths