Fixed uploadToTmp