<p>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).</p>

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

[{'answer_id': 136592, 'author': 'Walden Leverich', 'author_id': 2673770, 'author_profile': 'https://Stackoverflow.com/users/2673770', 'pm_score': 1, 'selected': False, 'text': '<p>We run an SaaS system that allows users to upload files. We\'d originally designed it to store MIME Types up to 50 characters. In the last several days we\'ve seen several attempts to upload 71-bytes types. So, we\'re changing to 250. 100 seemed "good" but it\'s only a few more than the max we\'re seeing now. 500 seems silly, so 250 is the selected one.</p>\n'}, {'answer_id': 1849792, 'author': 'speaker', 'author_id': 215670, 'author_profile': 'https://Stackoverflow.com/users/215670', 'pm_score': 7, 'selected': True, 'text': '<p>I hope I havn\'t misread, but it looks like the length is max 127/127 or <strong>255 total</strong>.</p>\n\n<p><a href="http://www.ietf.org/rfc/rfc4288.txt?number=4288" rel="noreferrer">RFC 4288</a> has a reference in 4.2 (page 6):</p>\n\n<pre><code>Type and subtype names MUST conform to the following ABNF:\n\n   type-name = reg-name\n   subtype-name = reg-name\n\n   reg-name = 1*127reg-name-chars\n   reg-name-chars = ALPHA / DIGIT / "!" /\n                   "#" / "$" / "&amp;" / "." /\n                   "+" / "-" / "^" / "_"\n</code></pre>\n\n<p>It is not clear to me if the +suffix can add past the 127, but it appears not.</p>\n'}, {'answer_id': 23928635, 'author': 'appleleaf', 'author_id': 3131821, 'author_profile': 'https://Stackoverflow.com/users/3131821', 'pm_score': 3, 'selected': False, 'text': '<p>In RFC 6838 which is latest standard and obsoletes RFC4288, there is a following statement.</p>\n<p>&quot;Also note that while this syntax allows names of up to 127 characters, implementation limits may make such long names problematic. For this reason, <code>&lt;type-name&gt;</code> and <code>&lt;subtype-name&gt;</code> SHOULD be limited to 64 characters.&quot;</p>\n<p>64+1+64 = 129.</p>\n<p>But I suspect the standard should mean 63+1+63=127.</p>\n<p>link: <a href="https://www.rfc-editor.org/rfc/rfc6838#section-4.2" rel="nofollow noreferrer">https://www.rfc-editor.org/rfc/rfc6838#section-4.2</a></p>\n'}]
['https://Stackoverflow.com/questions/19852', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2084/']