Maximum length of a MIME Content-Type header field?

前端 未结 3 510
野性不改
野性不改 2020-12-30 19:18

I\'m just designing the schema for a database table which will hold details of email attachments - their size in bytes, filename and content-type (i.e. \"image/jpg\", \"audi

3条回答
  •  误落风尘
    2020-12-30 19:44

    I hope I havn't misread, but it looks like the length is max 127/127 or 255 total.

    RFC 4288 has a reference in 4.2 (page 6):

    Type and subtype names MUST conform to the following ABNF:
    
       type-name = reg-name
       subtype-name = reg-name
    
       reg-name = 1*127reg-name-chars
       reg-name-chars = ALPHA / DIGIT / "!" /
                       "#" / "$" / "&" / "." /
                       "+" / "-" / "^" / "_"
    

    It is not clear to me if the +suffix can add past the 127, but it appears not.

提交回复
热议问题