人们在他们的数据库中使用什么作为 MIMEType 字段的长度?到目前为止我们看到的最长的是 72 字节:
application/vnd.openxmlformats-officedocument.wordprocessingml.document
但我只是在等待更长的时间。我们现在使用的是 250,但有没有人见过比这更长的 MIMEType?
编辑:根据接受的答案,类型和子类型各为 127,因此最大为 254,加上“/”是组合值的 255 的限制。
最佳答案
根据 RFC 4288“媒体类型规范和注册程序”,类型(例如“application”)和子类型(例如“vnd...”)都是 can be max 127 characters .所以包括斜杠在内,最大长度为 255。
编辑:同时,该文档已被 RFC 6838 废弃,它不会改变最大尺寸,但会添加一条注释:
Also note that while this syntax allows names of up to 127 characters, implementation limits may make such long names problematic. For this reason,
<type-name>
and<subtype-name>
SHOULD be limited to 64 characters.
关于database - 在数据库中存储类型时的最大 MIMEType 长度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/643690/