writing body to tmp folder