server writes to tempfile