better content-type & fileheader-checking