Fixed bug when deriving temp upload path