1 | <?xml version="1.0" encoding="UTF-8"?> |
---|
2 | <!-- |
---|
3 | This XML document is the output of clean-for-DTD.xslt; a tool that strips |
---|
4 | extensions to RFC2629(bis) from documents for processing with xml2rfc. |
---|
5 | --> |
---|
6 | <?xml-stylesheet type='text/xsl' href='../../draft-ietf-httpbis/myxml2rfc.xslt' ?> |
---|
7 | <?rfc toc="yes"?> |
---|
8 | <?rfc symrefs="yes"?> |
---|
9 | <?rfc sortrefs="yes"?> |
---|
10 | <?rfc compact="yes"?> |
---|
11 | <?rfc comments="yes"?> |
---|
12 | <?rfc inline="yes"?> |
---|
13 | <?rfc subcompact="no"?> |
---|
14 | <?rfc rfcedstyle="yes"?> |
---|
15 | <!DOCTYPE rfc |
---|
16 | PUBLIC "" "rfc2629.dtd"> |
---|
17 | <rfc ipr="trust200902" docName="draft-ietf-httpbis-content-disp-01" category="std" updates="2616"> |
---|
18 | <front> |
---|
19 | <title abbrev="Content-Disposition in HTTP">Use of the Content-Disposition Header Field |
---|
20 | in the Hypertext Transfer Protocol (HTTP)</title> |
---|
21 | <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke"> |
---|
22 | <organization abbrev="greenbytes">greenbytes GmbH</organization> |
---|
23 | <address> |
---|
24 | <postal> |
---|
25 | <street>Hafenweg 16</street> |
---|
26 | <city>Muenster</city><region>NW</region><code>48155</code> |
---|
27 | <country>Germany</country> |
---|
28 | </postal> |
---|
29 | <email>julian.reschke@greenbytes.de</email> |
---|
30 | <uri>http://greenbytes.de/tech/webdav/</uri> |
---|
31 | </address> |
---|
32 | </author> |
---|
33 | |
---|
34 | <date month="September" year="2010" day="16"/> |
---|
35 | <workgroup>HTTPbis Working Group</workgroup> |
---|
36 | |
---|
37 | <abstract> |
---|
38 | <t> |
---|
39 | HTTP/1.1 defines the Content-Disposition response header field, |
---|
40 | but points out that it is not part of the HTTP/1.1 Standard. |
---|
41 | This specification takes over the definition and registration of |
---|
42 | Content-Disposition, as used in HTTP, and clarifies internationalization |
---|
43 | aspects. |
---|
44 | </t> |
---|
45 | </abstract> |
---|
46 | |
---|
47 | <note title="Editorial Note (To be removed by RFC Editor before publication)"> |
---|
48 | <t> |
---|
49 | This specification is expected to replace the definition of Content-Disposition |
---|
50 | in the HTTP/1.1 specification, as currently revised by the IETF HTTPbis |
---|
51 | working group. See also <eref target="http://trac.tools.ietf.org/wg/httpbis/trac/ticket/123"/>. |
---|
52 | </t> |
---|
53 | <t> |
---|
54 | Discussion of this draft should take place on the HTTPBIS working group |
---|
55 | mailing list (ietf-http-wg@w3.org). The current issues list is |
---|
56 | at <eref target="http://trac.tools.ietf.org/wg/httpbis/trac/query?component=content-disp"/> |
---|
57 | and related documents (including fancy diffs) can be found at |
---|
58 | <eref target="http://tools.ietf.org/wg/httpbis/"/>. |
---|
59 | </t> |
---|
60 | <t> |
---|
61 | The changes in this draft are summarized in <xref target="changes.since.00"/>. |
---|
62 | </t> |
---|
63 | </note> |
---|
64 | </front> |
---|
65 | |
---|
66 | <middle> |
---|
67 | |
---|
68 | <section title="Introduction" anchor="introduction"> |
---|
69 | <t> |
---|
70 | HTTP/1.1 defines the Content-Disposition response header field in Section 19.5.1 of <xref target="RFC2616"/>, |
---|
71 | but points out that it is not part of the HTTP/1.1 Standard (Section 15.5): |
---|
72 | </t> |
---|
73 | <t><list> |
---|
74 | <t> |
---|
75 | Content-Disposition is not part of the HTTP standard, but since it is |
---|
76 | widely implemented, we are documenting its use and risks for implementers. |
---|
77 | </t> |
---|
78 | </list></t> |
---|
79 | <t> |
---|
80 | This specification takes over the definition and registration of |
---|
81 | Content-Disposition, as used in HTTP. |
---|
82 | Based on interoperability testing with existing User Agents, |
---|
83 | it fully defines a profile of the |
---|
84 | features defined in the Multipurpose Internet Mail Extensions (MIME) variant (<xref target="RFC2183"/>) of the |
---|
85 | header field, and also clarifies internationalization |
---|
86 | aspects. |
---|
87 | </t> |
---|
88 | </section> |
---|
89 | |
---|
90 | <section title="Notational Conventions"> |
---|
91 | <t> |
---|
92 | The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", |
---|
93 | "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document |
---|
94 | are to be interpreted as described in <xref target="RFC2119"/>. |
---|
95 | </t> |
---|
96 | <t> |
---|
97 | This specification uses the augmented BNF notation defined in |
---|
98 | Section 2.1 of <xref target="RFC2616"/>, including its rules for |
---|
99 | linear whitespace (LWS). |
---|
100 | </t> |
---|
101 | </section> |
---|
102 | |
---|
103 | <section title="Header Field Definition" anchor="header.field.definition"> |
---|
104 | <iref item="Headers" subitem="Content-Disposition" primary="true"/> |
---|
105 | <iref item="Content-Disposition header" primary="true"/> |
---|
106 | <t> |
---|
107 | The Content-Disposition response header field is used to convey additional |
---|
108 | information about how to process the response payload, and also can be used |
---|
109 | to attach additional metadata, such as the filename. |
---|
110 | </t> |
---|
111 | |
---|
112 | <section title="Grammar"> |
---|
113 | <figure><artwork type="abnf2616"><![CDATA[ |
---|
114 | content-disposition = "Content-Disposition" ":" |
---|
115 | disposition-type *( ";" disposition-parm ) |
---|
116 | |
---|
117 | disposition-type = "inline" | "attachment" | disp-ext-type |
---|
118 | ; case-insensitive |
---|
119 | disp-ext-type = token |
---|
120 | |
---|
121 | disposition-parm = filename-parm | disp-ext-parm |
---|
122 | |
---|
123 | filename-parm = "filename" "=" value |
---|
124 | | "filename*" "=" ext-value |
---|
125 | |
---|
126 | disp-ext-parm = token "=" value |
---|
127 | | ext-token "=" ext-value |
---|
128 | ext-token = <the characters in token, followed by "*"> |
---|
129 | ]]></artwork></figure> |
---|
130 | |
---|
131 | <figure><preamble>Defined in <xref target="RFC2616"/>:</preamble><artwork type="abnf2616"><![CDATA[ |
---|
132 | token = <token, defined in [RFC2616], Section 2.2> |
---|
133 | value = <value, defined in [RFC2616], Section 3.6> |
---|
134 | ]]></artwork></figure> |
---|
135 | <figure><preamble>Defined in <xref target="RFC5987"/>:</preamble><artwork type="abnf2616"><![CDATA[ |
---|
136 | ext-value = <ext-value, defined in [RFC5987], Section 3.2> |
---|
137 | ]]></artwork></figure> |
---|
138 | </section> |
---|
139 | |
---|
140 | <section title="Disposition Type" anchor="disposition.type"> |
---|
141 | <t> |
---|
142 | If the disposition type matches "attachment" (case-insensitively), this indicates that the user agent should not display the response, |
---|
143 | but directly enter a "save as..." dialog. |
---|
144 | </t> |
---|
145 | <t> |
---|
146 | On the other hand, if it matches "inline" (case-insensitively), this implies default processing. |
---|
147 | </t> |
---|
148 | <t> |
---|
149 | Unknown or unhandled disposition types SHOULD be handled the same way as "attachment" |
---|
150 | (see also <xref target="RFC2183"/>, Section 2.8). |
---|
151 | </t> |
---|
152 | </section> |
---|
153 | |
---|
154 | <section title="Disposition Parameter: 'Filename'" anchor="disposition.parameter.filename"> |
---|
155 | <t> |
---|
156 | The parameters "filename" and "filename*", to be matched case-insensitively, |
---|
157 | provide information on how to construct a filename for storing the message |
---|
158 | payload. |
---|
159 | </t> |
---|
160 | <t> |
---|
161 | Depending on the disposition type, this information might be used right away |
---|
162 | (in the "save as..." interaction caused for the "attachment" disposition type), |
---|
163 | or later on (for instance, when the user decides to save the contents of the |
---|
164 | current page being displayed). |
---|
165 | </t> |
---|
166 | <t> |
---|
167 | The parameters "filename" and "filename*" differ only in that "filename*" uses |
---|
168 | the encoding defined in <xref target="RFC5987"/>, allowing the use |
---|
169 | of characters not present in the ISO-8859-1 character set (<xref target="ISO-8859-1"/>). |
---|
170 | </t> |
---|
171 | <t> |
---|
172 | Many user agent implementations predating this specification |
---|
173 | do not understand the "filename*" parameter. Therefore, when both "filename" |
---|
174 | and "filename*" are present in a single header field value, recipients |
---|
175 | SHOULD pick "filename*" and ignore "filename". This way, senders |
---|
176 | can avoid special-casing specific user agents by sending both the |
---|
177 | more expressive "filename*" parameter, and the "filename" parameter |
---|
178 | as fallback for legacy recipients (see <xref target="examples"/> for |
---|
179 | an example). |
---|
180 | </t> |
---|
181 | <t> |
---|
182 | It is essential that user agents treat the specified filename as advisory |
---|
183 | only, thus be very careful in extracting the desired information. |
---|
184 | In particular: |
---|
185 | <list style="symbols"> |
---|
186 | <t> |
---|
187 | When the value contains path separator characters, all but the last |
---|
188 | segment SHOULD be ignored. This prevents unintentional overwriting |
---|
189 | of well-known file system location (such as "/etc/passwd"). |
---|
190 | </t> |
---|
191 | <t> |
---|
192 | Many platforms do not use Internet Media Types (<xref target="RFC2046"/>) |
---|
193 | to hold type information in the file system, but rely on filename |
---|
194 | extensions instead. Trusting the server-provided file extension could |
---|
195 | introduce a privilege escalation when later on the file is opened locally |
---|
196 | (consider ".exe"). Thus, recipients need to ensure that a file extension |
---|
197 | is used that is safe, optimally matching the media type of the received |
---|
198 | payload. |
---|
199 | </t> |
---|
200 | <t> |
---|
201 | Other aspects recipients need to be aware of are names that have a |
---|
202 | special meaning in the file system or in shell commands, such as "." and "..", |
---|
203 | "~", "|", and also device names. |
---|
204 | </t> |
---|
205 | </list> |
---|
206 | </t> |
---|
207 | </section> |
---|
208 | |
---|
209 | <section title="Disposition Parameter: Extensions" anchor="disposition.parameter.extensions"> |
---|
210 | <t> |
---|
211 | To enable future extensions, unknown parameters SHOULD be ignored (see also <xref target="RFC2183"/>, Section 2.8). |
---|
212 | </t> |
---|
213 | </section> |
---|
214 | |
---|
215 | <section title="Extensibility" anchor="extensibility"> |
---|
216 | <t> |
---|
217 | Note that Section 9 of <xref target="RFC2183"/> defines IANA registries both |
---|
218 | for disposition types and disposition parameters. This registry is |
---|
219 | shared by different protocols using Content-Disposition, such as MIME and HTTP. |
---|
220 | Therefore, not all registered values may make sense in the context of HTTP. |
---|
221 | </t> |
---|
222 | </section> |
---|
223 | |
---|
224 | </section> |
---|
225 | |
---|
226 | <section title="Examples" anchor="examples"> |
---|
227 | |
---|
228 | <figure> |
---|
229 | <preamble> |
---|
230 | Direct UA to show "save as" dialog, with a filename of "example.html": |
---|
231 | </preamble> |
---|
232 | <artwork type="example"><![CDATA[ |
---|
233 | Content-Disposition: Attachment; filename=example.html |
---|
234 | ]]></artwork></figure> |
---|
235 | <figure> |
---|
236 | <preamble> |
---|
237 | Direct UA to behave as if the Content-Disposition header field wasn't present, |
---|
238 | but to remember the filename "example.html" for a subsequent save operation: |
---|
239 | </preamble> |
---|
240 | <artwork type="example"><![CDATA[ |
---|
241 | Content-Disposition: INLINE; FILENAME= "example.html" |
---|
242 | ]]></artwork></figure> |
---|
243 | <figure> |
---|
244 | <preamble> |
---|
245 | Direct UA to show "save as" dialog, with a filename of "an example": |
---|
246 | </preamble> |
---|
247 | <artwork type="example"><![CDATA[ |
---|
248 | Content-Disposition: Attachment; Filename*=UTF-8'en'an%20example |
---|
249 | ]]></artwork> |
---|
250 | <postamble>Note that this example uses the extended encoding defined in |
---|
251 | <xref target="RFC5987"/> to specify that the natural language of the filename |
---|
252 | is English, and also to encode the space character which is not allowed in the |
---|
253 | token production. |
---|
254 | </postamble> |
---|
255 | </figure> |
---|
256 | <figure> |
---|
257 | <preamble> |
---|
258 | Direct UA to show "save as" dialog, with a filename containing the Unicode character U+20AC (EURO SIGN): |
---|
259 | </preamble> |
---|
260 | <artwork type="example"><![CDATA[ |
---|
261 | Content-Disposition: attachment; |
---|
262 | filename*= UTF-8''%e2%82%ac%20rates |
---|
263 | ]]></artwork> |
---|
264 | <postamble> |
---|
265 | Here, the encoding defined in <xref target="RFC5987"/> is also used to encode the |
---|
266 | non-ISO-8859-1 character. |
---|
267 | </postamble> |
---|
268 | </figure> |
---|
269 | <figure> |
---|
270 | <preamble> |
---|
271 | Same as above, but adding the "filename" parameter for compatibility with |
---|
272 | user agents not implementing RFC 5987: |
---|
273 | </preamble> |
---|
274 | <artwork type="example"><![CDATA[ |
---|
275 | Content-Disposition: attachment; |
---|
276 | filename="EURO rates"; |
---|
277 | filename*=utf-8''%e2%82%ac%20rates |
---|
278 | ]]></artwork> |
---|
279 | <postamble> |
---|
280 | Note: as of September 2010, those user agents that do not support the RFC 5987 |
---|
281 | encoding ignore "filename*" when it occurs after "filename". Unfortunately, |
---|
282 | some user agents that do support RFC 5987 do pick the "filename" rather |
---|
283 | than the "filename*" parameter when it occurs first; it is expected that |
---|
284 | this situation is going to improve soon. |
---|
285 | </postamble> |
---|
286 | </figure> |
---|
287 | |
---|
288 | </section> |
---|
289 | |
---|
290 | <section title="Internationalization Considerations" anchor="i18n"> |
---|
291 | <t> |
---|
292 | The "filename*" parameter (<xref target="disposition.parameter.filename"/>), |
---|
293 | using the encoding defined in <xref target="RFC5987"/>, allows the |
---|
294 | server to transmit characters outside the ISO-8859-1 character set, |
---|
295 | and also to optionally specify the language in use. |
---|
296 | </t> |
---|
297 | <t> |
---|
298 | Future parameters might also require internationalization, in which case |
---|
299 | the same encoding can be used. |
---|
300 | </t> |
---|
301 | </section> |
---|
302 | |
---|
303 | <section title="Security Considerations" anchor="security.considerations"> |
---|
304 | <t> |
---|
305 | Using server-supplied information for constructing local filenames introduces |
---|
306 | many risks. These are summarized in <xref target="disposition.parameter.filename"/>. |
---|
307 | </t> |
---|
308 | <t> |
---|
309 | Furthermore, implementers also ought to be aware of the Security |
---|
310 | Considerations applying to HTTP (see Section 15 of <xref target="RFC2616"/>), and also the parameter encoding defined in <xref target="RFC5987"/> |
---|
311 | (see Section 5). |
---|
312 | </t> |
---|
313 | </section> |
---|
314 | |
---|
315 | <section title="IANA Considerations" anchor="iana.considerations"> |
---|
316 | |
---|
317 | <section title="Registry for Disposition Values and Parameter" anchor="registry"> |
---|
318 | <t> |
---|
319 | This specification does not introduce any changes to the registration |
---|
320 | procedures for disposition values and parameters that are defined in |
---|
321 | Section 9 of <xref target="RFC2183"/>. |
---|
322 | </t> |
---|
323 | </section> |
---|
324 | |
---|
325 | <section title="Header Field Registration" anchor="header.field.registration"> |
---|
326 | <t> |
---|
327 | This document updates the definition of the Content-Disposition HTTP header field |
---|
328 | in the permanent HTTP header field registry (see <xref target="RFC3864"/>). |
---|
329 | </t> |
---|
330 | <t> |
---|
331 | <list style="hanging"> |
---|
332 | <t hangText="Header field name:">Content-Disposition</t> |
---|
333 | <t hangText="Applicable protocol:">http</t> |
---|
334 | <t hangText="Status:">standard</t> |
---|
335 | <t hangText="Author/Change controller:">IETF</t> |
---|
336 | <t hangText="Specification document:">this specification (<xref target="header.field.definition"/>)</t> |
---|
337 | </list> |
---|
338 | </t> |
---|
339 | </section> |
---|
340 | |
---|
341 | </section> |
---|
342 | |
---|
343 | <section title="Acknowledgements"> |
---|
344 | <t> |
---|
345 | Thanks to Rolf Eike Beer, Bjoern Hoehrmann, Alfred Hoenes, Roar Lauritzsen, |
---|
346 | and Henrik Nordstrom for their valuable feedback. |
---|
347 | </t> |
---|
348 | </section> |
---|
349 | |
---|
350 | </middle> |
---|
351 | <back> |
---|
352 | |
---|
353 | <references title="Normative References"> |
---|
354 | |
---|
355 | <reference anchor="RFC2119"> |
---|
356 | <front> |
---|
357 | <title abbrev="RFC Key Words">Key words for use in RFCs to Indicate Requirement Levels</title> |
---|
358 | <author initials="S." surname="Bradner" fullname="Scott Bradner"> |
---|
359 | <organization>Harvard University</organization> |
---|
360 | <address><email>sob@harvard.edu</email></address> |
---|
361 | </author> |
---|
362 | <date month="March" year="1997"/> |
---|
363 | <area>General</area> |
---|
364 | <keyword>keyword</keyword> |
---|
365 | </front> |
---|
366 | <seriesInfo name="BCP" value="14"/> |
---|
367 | <seriesInfo name="RFC" value="2119"/> |
---|
368 | </reference> |
---|
369 | |
---|
370 | <reference anchor="RFC2616"> |
---|
371 | <front> |
---|
372 | <title>Hypertext Transfer Protocol -- HTTP/1.1</title> |
---|
373 | <author initials="R." surname="Fielding" fullname="R. Fielding"> |
---|
374 | <organization>University of California, Irvine</organization> |
---|
375 | <address><email>fielding@ics.uci.edu</email></address> |
---|
376 | </author> |
---|
377 | <author initials="J." surname="Gettys" fullname="J. Gettys"> |
---|
378 | <organization>W3C</organization> |
---|
379 | <address><email>jg@w3.org</email></address> |
---|
380 | </author> |
---|
381 | <author initials="J." surname="Mogul" fullname="J. Mogul"> |
---|
382 | <organization>Compaq Computer Corporation</organization> |
---|
383 | <address><email>mogul@wrl.dec.com</email></address> |
---|
384 | </author> |
---|
385 | <author initials="H." surname="Frystyk" fullname="H. Frystyk"> |
---|
386 | <organization>MIT Laboratory for Computer Science</organization> |
---|
387 | <address><email>frystyk@w3.org</email></address> |
---|
388 | </author> |
---|
389 | <author initials="L." surname="Masinter" fullname="L. Masinter"> |
---|
390 | <organization>Xerox Corporation</organization> |
---|
391 | <address><email>masinter@parc.xerox.com</email></address> |
---|
392 | </author> |
---|
393 | <author initials="P." surname="Leach" fullname="P. Leach"> |
---|
394 | <organization>Microsoft Corporation</organization> |
---|
395 | <address><email>paulle@microsoft.com</email></address> |
---|
396 | </author> |
---|
397 | <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee"> |
---|
398 | <organization>W3C</organization> |
---|
399 | <address><email>timbl@w3.org</email></address> |
---|
400 | </author> |
---|
401 | <date month="June" year="1999"/> |
---|
402 | </front> |
---|
403 | <seriesInfo name="RFC" value="2616"/> |
---|
404 | </reference> |
---|
405 | |
---|
406 | <reference anchor="RFC5987"> |
---|
407 | <front> |
---|
408 | <title>Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters</title> |
---|
409 | <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke"> |
---|
410 | <organization abbrev="greenbytes">greenbytes GmbH</organization> |
---|
411 | <address> |
---|
412 | <postal> |
---|
413 | <street>Hafenweg 16</street> |
---|
414 | <city>Muenster</city><region>NW</region><code>48155</code> |
---|
415 | <country>Germany</country> |
---|
416 | </postal> |
---|
417 | <email>julian.reschke@greenbytes.de</email> |
---|
418 | <uri>http://greenbytes.de/tech/webdav/</uri> |
---|
419 | </address> |
---|
420 | </author> |
---|
421 | <date month="August" year="2010"/> |
---|
422 | </front> |
---|
423 | <seriesInfo name="RFC" value="5987"/> |
---|
424 | </reference> |
---|
425 | |
---|
426 | <reference anchor="ISO-8859-1"> |
---|
427 | <front> |
---|
428 | <title>Information technology -- 8-bit single-byte coded graphic character sets -- Part 1: Latin alphabet No. 1</title> |
---|
429 | <author> |
---|
430 | <organization>International Organization for Standardization</organization> |
---|
431 | </author> |
---|
432 | <date year="1998"/> |
---|
433 | </front> |
---|
434 | <seriesInfo name="ISO/IEC" value="8859-1:1998"/> |
---|
435 | </reference> |
---|
436 | |
---|
437 | </references> |
---|
438 | |
---|
439 | <references title="Informative References"> |
---|
440 | |
---|
441 | <reference anchor="RFC2046"> |
---|
442 | <front> |
---|
443 | <title abbrev="Media Types">Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types</title> |
---|
444 | <author initials="N." surname="Freed" fullname="Ned Freed"> |
---|
445 | <organization>Innosoft International, Inc.</organization> |
---|
446 | <address><email>ned@innosoft.com</email></address> |
---|
447 | </author> |
---|
448 | <author initials="N." surname="Borenstein" fullname="Nathaniel S. Borenstein"> |
---|
449 | <organization>First Virtual Holdings</organization> |
---|
450 | <address><email>nsb@nsb.fv.com</email></address> |
---|
451 | </author> |
---|
452 | <date month="November" year="1996"/> |
---|
453 | </front> |
---|
454 | <seriesInfo name="RFC" value="2046"/> |
---|
455 | </reference> |
---|
456 | |
---|
457 | <reference anchor="RFC2047"> |
---|
458 | <front> |
---|
459 | <title abbrev="Message Header Extensions">MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text</title> |
---|
460 | <author initials="K." surname="Moore" fullname="Keith Moore"> |
---|
461 | <organization>University of Tennessee</organization> |
---|
462 | <address><email>moore@cs.utk.edu</email></address> |
---|
463 | </author> |
---|
464 | <date month="November" year="1996"/> |
---|
465 | </front> |
---|
466 | <seriesInfo name="RFC" value="2047"/> |
---|
467 | </reference> |
---|
468 | |
---|
469 | <reference anchor="RFC2183"> |
---|
470 | <front> |
---|
471 | <title abbrev="Content-Disposition">Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field</title> |
---|
472 | <author initials="R." surname="Troost" fullname="Rens Troost"> |
---|
473 | <organization>New Century Systems</organization> |
---|
474 | <address><email>rens@century.com</email></address> |
---|
475 | </author> |
---|
476 | <author initials="S." surname="Dorner" fullname="Steve Dorner"> |
---|
477 | <organization>QUALCOMM Incorporated</organization> |
---|
478 | <address><email>sdorner@qualcomm.com</email></address> |
---|
479 | </author> |
---|
480 | <author initials="K." surname="Moore" fullname="Keith Moore"> |
---|
481 | <organization>Department of Computer Science</organization> |
---|
482 | <address><email>moore@cs.utk.edu</email></address> |
---|
483 | </author> |
---|
484 | <date year="1997" month="August"/> |
---|
485 | </front> |
---|
486 | <seriesInfo name="RFC" value="2183"/> |
---|
487 | </reference> |
---|
488 | |
---|
489 | <reference anchor="RFC2231"> |
---|
490 | <front> |
---|
491 | <title abbrev="MIME Value and Encoded Word Extensions">MIME Parameter Value and Encoded Word Extensions: Character Sets, Languages, and Continuations</title> |
---|
492 | <author initials="N." surname="Freed" fullname="Ned Freed"> |
---|
493 | <organization abbrev="Innosoft">Innosoft International, Inc.</organization> |
---|
494 | <address><email>ned.freed@innosoft.com</email></address> |
---|
495 | </author> |
---|
496 | <author initials="K." surname="Moore" fullname="Keith Moore"> |
---|
497 | <organization>University of Tennessee</organization> |
---|
498 | <address><email>moore@cs.utk.edu</email></address> |
---|
499 | </author> |
---|
500 | <date year="1997" month="November"/> |
---|
501 | </front> |
---|
502 | <seriesInfo name="RFC" value="2231"/> |
---|
503 | </reference> |
---|
504 | |
---|
505 | <reference anchor="RFC3629"> |
---|
506 | <front> |
---|
507 | <title>UTF-8, a transformation format of ISO 10646</title> |
---|
508 | <author initials="F." surname="Yergeau" fullname="F. Yergeau"> |
---|
509 | <organization>Alis Technologies</organization> |
---|
510 | <address><email>fyergeau@alis.com</email></address> |
---|
511 | </author> |
---|
512 | <date month="November" year="2003"/> |
---|
513 | </front> |
---|
514 | <seriesInfo name="STD" value="63"/> |
---|
515 | <seriesInfo name="RFC" value="3629"/> |
---|
516 | </reference> |
---|
517 | |
---|
518 | <reference anchor="RFC3864"> |
---|
519 | <front> |
---|
520 | <title>Registration Procedures for Message Header Fields</title> |
---|
521 | <author initials="G." surname="Klyne" fullname="G. Klyne"> |
---|
522 | <organization>Nine by Nine</organization> |
---|
523 | <address><email>GK-IETF@ninebynine.org</email></address> |
---|
524 | </author> |
---|
525 | <author initials="M." surname="Nottingham" fullname="M. Nottingham"> |
---|
526 | <organization>BEA Systems</organization> |
---|
527 | <address><email>mnot@pobox.com</email></address> |
---|
528 | </author> |
---|
529 | <author initials="J." surname="Mogul" fullname="J. Mogul"> |
---|
530 | <organization>HP Labs</organization> |
---|
531 | <address><email>JeffMogul@acm.org</email></address> |
---|
532 | </author> |
---|
533 | <date year="2004" month="September"/> |
---|
534 | </front> |
---|
535 | <seriesInfo name="BCP" value="90"/> |
---|
536 | <seriesInfo name="RFC" value="3864"/> |
---|
537 | </reference> |
---|
538 | |
---|
539 | <reference anchor="RFC3986"> |
---|
540 | <front> |
---|
541 | <title abbrev="URI Generic Syntax">Uniform Resource Identifier (URI): Generic Syntax</title> |
---|
542 | <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee"> |
---|
543 | <organization abbrev="W3C/MIT">World Wide Web Consortium</organization> |
---|
544 | <address> |
---|
545 | <email>timbl@w3.org</email> |
---|
546 | <uri>http://www.w3.org/People/Berners-Lee/</uri> |
---|
547 | </address> |
---|
548 | </author> |
---|
549 | <author initials="R." surname="Fielding" fullname="Roy T. Fielding"> |
---|
550 | <organization abbrev="Day Software">Day Software</organization> |
---|
551 | <address> |
---|
552 | <email>fielding@gbiv.com</email> |
---|
553 | <uri>http://roy.gbiv.com/</uri> |
---|
554 | </address> |
---|
555 | </author> |
---|
556 | <author initials="L." surname="Masinter" fullname="Larry Masinter"> |
---|
557 | <organization abbrev="Adobe Systems">Adobe Systems Incorporated</organization> |
---|
558 | <address> |
---|
559 | <email>LMM@acm.org</email> |
---|
560 | <uri>http://larry.masinter.net/</uri> |
---|
561 | </address> |
---|
562 | </author> |
---|
563 | <date month="January" year="2005"/> |
---|
564 | </front> |
---|
565 | <seriesInfo name="STD" value="66"/> |
---|
566 | <seriesInfo name="RFC" value="3986"/> |
---|
567 | </reference> |
---|
568 | |
---|
569 | </references> |
---|
570 | |
---|
571 | <section title="Changes from the RFC 2616 Definition" anchor="changes.from.rfc2616"> |
---|
572 | <t> |
---|
573 | Compared to Section 19.5.1 of <xref target="RFC2616"/>, the following |
---|
574 | normative changes reflecting actual implementations have been made: |
---|
575 | <list style="symbols"> |
---|
576 | <t> |
---|
577 | According to RFC 2616, the disposition type "attachment" only applies to |
---|
578 | content of type "application/octet-stream". This restriction has been |
---|
579 | removed, because user agents in practice do not check the content type, and |
---|
580 | it also discourages properly declaring the media type. |
---|
581 | </t> |
---|
582 | <t> |
---|
583 | RFC 2616 only allows "quoted-string" for the filename parameter. This |
---|
584 | would be an exceptional parameter syntax, and also doesn't reflect actual |
---|
585 | use. |
---|
586 | </t> |
---|
587 | <t> |
---|
588 | The definition for the disposition type "inline" (<xref target="RFC2183"/>, Section 2.1) |
---|
589 | has been re-added with a suggestion for its processing. |
---|
590 | </t> |
---|
591 | <t> |
---|
592 | This specification requires support for the extended parameter encoding |
---|
593 | defined in <xref target="RFC5987"/>. |
---|
594 | </t> |
---|
595 | </list> |
---|
596 | </t> |
---|
597 | </section> |
---|
598 | |
---|
599 | <section title="Differences compared to RFC 2183" anchor="diffs.compared.to.rfc2183"> |
---|
600 | <t> |
---|
601 | Section 2 of <xref target="RFC2183"/> defines several additional |
---|
602 | disposition parameters: "creation-date", "modification-date", |
---|
603 | "quoted-date-time", and "size". These do not appear to be implemented by |
---|
604 | any user agent, thus have been omitted from this specification. |
---|
605 | </t> |
---|
606 | </section> |
---|
607 | |
---|
608 | <section title="Alternative Approaches to Internationalization" anchor="alternatives"> |
---|
609 | <t> |
---|
610 | By default, HTTP header field parameters cannot carry characters outside |
---|
611 | the ISO-8859-1 (<xref target="ISO-8859-1"/>) character encoding (see |
---|
612 | <xref target="RFC2616"/>, Section 2.2). For the "filename" |
---|
613 | parameter, this of course is an unacceptable restriction. |
---|
614 | </t> |
---|
615 | <t> |
---|
616 | Unfortunately, user agent implementers have not managed to come up with |
---|
617 | an interoperable approach, although the IETF Standards Track specifies |
---|
618 | exactly one solution (<xref target="RFC2231"/>, clarified and profiled for |
---|
619 | HTTP in <xref target="RFC5987"/>). |
---|
620 | </t> |
---|
621 | <t> |
---|
622 | For completeness, the sections below describe the various approaches that |
---|
623 | have been tried, and explains how they are inferior to the RFC 5987 |
---|
624 | encoding used in this specification. |
---|
625 | </t> |
---|
626 | |
---|
627 | <section title="RFC 2047 Encoding" anchor="alternatives.rfc2047"> |
---|
628 | <t> |
---|
629 | RFC 2047 defines an encoding mechanism for |
---|
630 | header fields, but this encoding is not supposed to be used for |
---|
631 | header field parameters - see Section 5 of <xref target="RFC2047"/>: |
---|
632 | </t> |
---|
633 | <t><list> |
---|
634 | <t> |
---|
635 | An 'encoded-word' MUST NOT appear within a 'quoted-string'. |
---|
636 | </t> |
---|
637 | <t> |
---|
638 | ... |
---|
639 | </t> |
---|
640 | <t> |
---|
641 | An 'encoded-word' MUST NOT be used in parameter of a MIME Content-Type or Content-Disposition field, or in any structured field body except within a 'comment' or 'phrase'. |
---|
642 | </t> |
---|
643 | </list></t> |
---|
644 | <t> |
---|
645 | In practice, some user agents implement the encoding, some do not |
---|
646 | (exposing the encoded string to the user), and some get confused by it. |
---|
647 | </t> |
---|
648 | </section> |
---|
649 | |
---|
650 | <section title="Percent Encoding" anchor="alternatives.percent"> |
---|
651 | <t> |
---|
652 | Some user agents accept percent encoded (<xref target="RFC3986"/>, Section 2.1) |
---|
653 | sequences of characters encoded using the UTF-8 (<xref target="RFC3629"/>) character encoding. |
---|
654 | </t> |
---|
655 | <t> |
---|
656 | In practice, this is hard to use because those user agents |
---|
657 | that do not support it will display the escaped character sequence to the user. |
---|
658 | </t> |
---|
659 | <t> |
---|
660 | Furthermore, the first user agent to implement this did choose the encoding |
---|
661 | based on local settings; thus making it very hard to use in multi-lingual |
---|
662 | environments. |
---|
663 | </t> |
---|
664 | </section> |
---|
665 | |
---|
666 | <section title="Encoding Sniffing" anchor="alternatives.sniff"> |
---|
667 | <t> |
---|
668 | Some user agents inspect the value (which defaults to ISO-8859-1) and |
---|
669 | switch to UTF-8 when it seems to be more likely to be the correct |
---|
670 | interpretation. |
---|
671 | </t> |
---|
672 | <t> |
---|
673 | As with the approaches above, this is not interoperable and furthermore |
---|
674 | risks misinterpreting the actual value. |
---|
675 | </t> |
---|
676 | </section> |
---|
677 | |
---|
678 | <section title="Implementations (to be removed by RFC Editor before publication)" anchor="alternatives.implementations"> |
---|
679 | <t> |
---|
680 | Unfortunately, as of September 2010, neither the encoding defined in RFCs 2231 |
---|
681 | and 5987, nor any of the alternate approaches discussed above was |
---|
682 | implemented interoperably. Thus, this specification recommends the approach |
---|
683 | defined in RFC 5987, which at least has the advantage of actually being |
---|
684 | specified properly. |
---|
685 | </t> |
---|
686 | <t> |
---|
687 | The table below shows the implementation support for the various approaches: |
---|
688 | </t> |
---|
689 | <texttable align="left"> |
---|
690 | <ttcol>User Agent</ttcol> |
---|
691 | <ttcol>RFC 2231/5987</ttcol> |
---|
692 | <ttcol>RFC 2047</ttcol> |
---|
693 | <ttcol>Percent Encoding</ttcol> |
---|
694 | <ttcol>Encoding Sniffing</ttcol> |
---|
695 | |
---|
696 | <c>Chrome</c> |
---|
697 | <c>no</c> |
---|
698 | <c>yes</c> |
---|
699 | <c>yes</c> |
---|
700 | <c>yes</c> |
---|
701 | |
---|
702 | <c>Firefox</c> |
---|
703 | <c>yes (*)</c> |
---|
704 | <c>yes</c> |
---|
705 | <c>no</c> |
---|
706 | <c>yes</c> |
---|
707 | |
---|
708 | <c>Internet Explorer</c> |
---|
709 | <c>no</c> |
---|
710 | <c>no</c> |
---|
711 | <c>yes</c> |
---|
712 | <c>no</c> |
---|
713 | |
---|
714 | <c>Konqueror</c> |
---|
715 | <c>yes</c> |
---|
716 | <c>no</c> |
---|
717 | <c>no</c> |
---|
718 | <c>no</c> |
---|
719 | |
---|
720 | <c>Opera</c> |
---|
721 | <c>yes (*)</c> |
---|
722 | <c>no</c> |
---|
723 | <c>no</c> |
---|
724 | <c>no</c> |
---|
725 | |
---|
726 | <c>Safari</c> |
---|
727 | <c>no</c> |
---|
728 | <c>no</c> |
---|
729 | <c>no</c> |
---|
730 | <c>yes</c> |
---|
731 | |
---|
732 | <postamble> |
---|
733 | (*) Does not implement the fallback behavior to "filename" described in |
---|
734 | <xref target="disposition.parameter.filename"/>. |
---|
735 | </postamble> |
---|
736 | |
---|
737 | </texttable> |
---|
738 | |
---|
739 | </section> |
---|
740 | |
---|
741 | </section> |
---|
742 | |
---|
743 | |
---|
744 | <section title="Change Log (to be removed by RFC Editor before publication)" anchor="change.log"> |
---|
745 | <section title="Since draft-reschke-rfc2183-in-http-00"> |
---|
746 | <t> |
---|
747 | Adjust terminology ("header" -> "header field"). |
---|
748 | Update rfc2231-in-http reference. |
---|
749 | </t> |
---|
750 | </section> |
---|
751 | |
---|
752 | |
---|
753 | <section title="Since draft-reschke-rfc2183-in-http-01"> |
---|
754 | <t> |
---|
755 | Update rfc2231-in-http reference. Actually define the "filename" |
---|
756 | parameter. Add internationalization considerations. |
---|
757 | Add examples using the RFC 5987 encoding. |
---|
758 | Add overview over other approaches, plus a table reporting |
---|
759 | implementation status. |
---|
760 | Add and resolve issue "nodep2183". |
---|
761 | Add issues "asciivsiso", |
---|
762 | "deplboth", "quoted", and "registry". |
---|
763 | </t> |
---|
764 | </section> |
---|
765 | |
---|
766 | <section title="Since draft-reschke-rfc2183-in-http-02"> |
---|
767 | <t> |
---|
768 | Add and close issue "docfallback". |
---|
769 | Close issues "asciivsiso", "deplboth", "quoted", and |
---|
770 | "registry". |
---|
771 | </t> |
---|
772 | </section> |
---|
773 | |
---|
774 | <section title="Since draft-reschke-rfc2183-in-http-03"> |
---|
775 | <t> |
---|
776 | Updated to be a Working Draft of the IETF HTTPbis Working Group. |
---|
777 | </t> |
---|
778 | </section> |
---|
779 | |
---|
780 | <section title="Since draft-ietf-httpbis-content-disp-00" anchor="changes.since.00"> |
---|
781 | <t> |
---|
782 | Closed issues: |
---|
783 | <list style="symbols"> |
---|
784 | <t> |
---|
785 | <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/242"/>: |
---|
786 | "handling of unknown disposition types" |
---|
787 | </t> |
---|
788 | </list> |
---|
789 | </t> |
---|
790 | <t> |
---|
791 | Slightly updated the notes about the proposed fallback behavior. |
---|
792 | </t> |
---|
793 | </section> |
---|
794 | </section> |
---|
795 | |
---|
796 | |
---|
797 | </back> |
---|
798 | |
---|
799 | </rfc> |
---|