MIME内容类型头字段的最大长度? [英] Maximum length of a MIME Content-Type header field?

查看:152
本文介绍了MIME内容类型头字段的最大长度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是设计一个数据库表的模式,它将保存电子邮件附件的细节 - 其大小(以字节为单位),文件名和内容类型(即image / jpg,audio / mp3等) / p>

有人知道我可以期待内容类型的最大长度吗?

解决方案

我希望我不会误读,但看起来长度最大为127/127或 255总共



RFC 4288 在4.2(第6页)中有参考:

 类型和子类型名称必须符合以下ABNF:

type-name = reg-name
subtype-name = reg-name

reg-name = 1 * 127reg-name-chars
reg-name-chars = ALPHA / DIGIT /! /
#/$/& /。 /
+/ - /^/_

对我来说,如果+后缀可以添加到127以上,但不显示,但不显示。


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", "audio/mp3", etc).

Does anybody know the maximum length that I can expect a content-type to be?

解决方案

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.

这篇关于MIME内容类型头字段的最大长度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆