check MIME And Write Header