Check for tempdir once
Changing if blocks
Merge pull request #397 from garcia-jj/ot-betterupload

Check for tempdir once