Fix another bug with uploads using writeFile