ASM-2182 fix variable ordering for upload_file case

The path and cwd variables were being set after they were used for the
upload_file case, causing that to fail.
Merge pull request #2 from gavin-scott/asm-2182

ASM-2182 fix variable ordering for upload_file case