source: draft-ietf-httpbis-content-disp/09/draft-ietf-httpbis-content-disp-09.xml @ 1325

Last change on this file since 1325 was 1211, checked in by julian.reschke@…, 12 years ago

Prepare publication of C-D -08 on March 28.

  • Property svn:eol-style set to native
File size: 39.4 KB
Line 
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-09" 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="March" year="2011" day="28"/>
35  <workgroup>HTTPbis Working Group</workgroup>
36 
37  <abstract>
38    <t>
39      RFC 2616 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.08"/>.
62    </t>
63  </note>
64  </front>
65
66  <middle>
67
68<section title="Introduction" anchor="introduction">
69<t>
70  RFC 2616 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<t><list>
89  <t>
90    Note: this document does not apply to Content-Disposition
91    header fields appearing in payload bodies transmitted over HTTP, such as
92    when using the media type "multipart/form-data" (<xref target="RFC2388"/>).
93  </t>
94</list></t>
95</section> 
96
97<section title="Notational Conventions" anchor="notational.conventions">
98<t>
99  The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
100  "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document
101  are to be interpreted as described in <xref target="RFC2119"/>.
102</t>
103<t>
104  This specification uses the augmented BNF (ABNF) notation defined in
105  Section 2.1 of <xref target="RFC2616"/>, including its rules for
106  implied linear whitespace (LWS).
107</t>
108</section>
109
110<section title="Conformance and Error Handling" anchor="conformance.and.error.handling">
111<t>
112  This specification defines conformance criteria for both senders (usually,
113  HTTP origin servers) and recipients (usually, HTTP user agents) of the
114  Content-Disposition header field. An implementation is considered conformant if
115  it complies with all of the requirements associated with its role.
116</t>
117<t>
118  This specification also defines certain forms of the header field-value to be
119  invalid, using both ABNF and prose requirements (<xref target="header.field.definition"/>),
120  but it does not define special handling of these invalid field-values.
121</t>
122<t>
123  Senders MUST NOT generate Content-Disposition header fields that are
124  invalid.
125</t>
126<t>
127  Recipients MAY take steps to recover a usable field-value
128  from an invalid header field, but SHOULD NOT reject the message outright,
129  unless this is explicitly desirable behaviour (e.g., the implementation is a
130  validator). As such, the default handling of invalid fields is to ignore them.
131</t>
132</section>
133
134<section title="Header Field Definition" anchor="header.field.definition">
135  <iref item="Header Fields" subitem="Content-Disposition" primary="true"/>
136  <iref item="Content-Disposition header field" primary="true"/>
137<t>
138  The Content-Disposition response header field is used to convey additional
139  information about how to process the response payload, and also can be used
140  to attach additional metadata, such as the filename to use when saving the
141  response payload locally.
142</t>
143
144<section title="Grammar">
145<figure><artwork type="abnf2616"><![CDATA[
146  content-disposition = "Content-Disposition" ":"
147                         disposition-type *( ";" disposition-parm )
148
149  disposition-type    = "inline" | "attachment" | disp-ext-type
150                      ; case-insensitive
151  disp-ext-type       = token
152
153  disposition-parm    = filename-parm | disp-ext-parm
154
155  filename-parm       = "filename" "=" value
156                      | "filename*" "=" ext-value
157 
158  disp-ext-parm       = token "=" value
159                      | ext-token "=" ext-value
160  ext-token           = <the characters in token, followed by "*">
161]]></artwork></figure>
162
163<figure><preamble>Defined in <xref target="RFC2616"/>:</preamble><artwork type="abnf2616"><![CDATA[
164  token         = <token, defined in [RFC2616], Section 2.2>
165  quoted-string = <quoted-string, defined in [RFC2616], Section 2.2>
166  value         = <value, defined in [RFC2616], Section 3.6>
167                ; token | quoted-string
168             
169]]></artwork></figure>
170<figure><preamble>Defined in <xref target="RFC5987"/>:</preamble><artwork type="abnf2616"><![CDATA[
171  ext-value   = <ext-value, defined in [RFC5987], Section 3.2>
172]]></artwork></figure>
173<t>
174  Content-Disposition header field values with multiple instances of the same
175  parameter name are invalid.
176</t>
177<t>
178  Note that due to the rules for implied linear whitespace
179  (Section 2.1 of <xref target="RFC2616"/>), OPTIONAL whitespace can
180  appear between words (token or quoted-string) and separator characters.
181</t>
182<t>
183  Furthermore note that the format used for ext-value allows specifying a
184  natural language (e.g., "en"); this is of limited use for filenames and is
185  likely to be ignored by recipients.
186</t>
187</section>
188
189<section title="Disposition Type" anchor="disposition.type">
190<t>
191  If the disposition type matches "attachment" (case-insensitively), this
192  indicates that the recipient should prompt the user to save the response
193  locally, rather than process it normally (as per its media type).
194</t>
195<t>
196  On the other hand, if it matches "inline" (case-insensitively), this implies
197  default processing. Therefore, the disposition type "inline" is only useful
198  when it is augmented with additional parameters, such as the filename (see
199  below).
200</t>
201<t>
202  Unknown or unhandled disposition types SHOULD be handled by recipients the
203  same way as "attachment" (see also <xref target="RFC2183"/>, Section 2.8).
204</t>
205</section>
206
207<section title="Disposition Parameter: 'Filename'" anchor="disposition.parameter.filename">
208<t>
209  The parameters "filename" and "filename*", to be matched case-insensitively,
210  provide information on how to construct a filename for storing the message
211  payload.
212</t>
213<t>
214  Depending on the disposition type, this information might be used right away
215  (in the "save as..." interaction caused for the "attachment" disposition type),
216  or later on (for instance, when the user decides to save the contents of the
217  current page being displayed).
218</t>
219<t>
220  The parameters "filename" and "filename*" differ only in that "filename*" uses
221  the encoding defined in <xref target="RFC5987"/>, allowing the use
222  of characters not present in the ISO-8859-1 character set (<xref target="ISO-8859-1"/>).
223</t>
224<t>
225  Many user agent implementations predating this specification
226  do not understand the "filename*" parameter. Therefore, when both "filename"
227  and "filename*" are present in a single header field value, recipients
228  SHOULD pick "filename*" and ignore "filename". This way, senders
229  can avoid special-casing specific user agents by sending both the
230  more expressive "filename*" parameter, and the "filename" parameter
231  as fallback for legacy recipients (see <xref target="examples"/> for
232  an example).
233</t>
234<t>
235  It is essential that recipients treat the specified filename as advisory
236  only, thus be very careful in extracting the desired information.
237  In particular:
238  <list style="symbols">
239    <t>
240      Recipients MUST NOT be able to write into any location other than one
241      to which they are specifically entitled. To illustrate the problem
242      consider the consequences of being able to overwrite well-known system
243      locations (such as "/etc/passwd"). One strategy to achieve this is to
244      never trust folder name information in the filename parameter, for
245      instance by stripping all but the last path segment and only consider the
246      actual filename (where 'path segment' are the components of the field
247      value delimited by the path separator characters "\" and "/").
248    </t>
249    <t>
250      Many platforms do not use Internet Media Types (<xref target="RFC2046"/>)
251      to hold type information in the file system, but rely on filename
252      extensions instead. Trusting the server-provided file extension could
253      introduce a privilege escalation when the saved file is later opened
254      (consider ".exe"). Thus, recipients which make use of file extensions
255      to determine the media type MUST ensure that a file extension
256      is used that is safe, optimally matching the media type of the received
257      payload.
258    </t>
259    <t>
260      Recipients SHOULD strip or replace character sequences that are
261      known to cause confusion both in user interfaces and in filenames, such as
262      control characters and leading and trailing whitespace.
263    </t>
264    <t>
265      Other aspects recipients need to be aware of are names that have a
266      special meaning in the file system or in shell commands, such as "." and "..",
267      "~", "|", and also device names. Recipients SHOULD ignore or substitute
268      names like these.
269    </t>
270  </list>
271</t>
272<t><list>
273  <t>
274    Note: Many user agents do not properly handle the escape
275    character "\" when using the quoted-string form. Furthermore, some user agents
276    erroneously try to perform unescaping of "percent" escapes (see
277    <xref target="alternatives.percent"/>), and thus might misinterpret
278    filenames containing the percent character followed by two hex digits.
279  </t>
280</list></t>
281</section>
282
283<section title="Disposition Parameter: Extensions" anchor="disposition.parameter.extensions">
284<t>
285  To enable future extensions, recipients SHOULD ignore unrecognized
286  parameters (see also <xref target="RFC2183"/>, Section 2.8).
287</t>
288</section>
289
290<section title="Extensibility" anchor="extensibility">
291<t>
292  Note that Section 9 of <xref target="RFC2183"/> defines IANA registries both
293  for disposition types and disposition parameters. This registry is
294  shared by different protocols using Content-Disposition, such as MIME and HTTP.
295  Therefore, not all registered values may make sense in the context of HTTP.
296</t>
297</section>
298
299</section> 
300
301<section title="Examples" anchor="examples">
302
303<figure>
304<preamble>
305Direct UA to show "save as" dialog, with a filename of "example.html": 
306</preamble>
307<artwork type="example"><![CDATA[
308Content-Disposition: Attachment; filename=example.html
309]]></artwork></figure>
310<figure>
311<preamble>
312Direct UA to behave as if the Content-Disposition header field wasn't present,
313but to remember the filename "an example.html" for a subsequent save operation:
314</preamble>
315<artwork type="example"><![CDATA[
316  Content-Disposition: INLINE; FILENAME= "an example.html"
317  ]]></artwork>
318<postamble>
319  Note: this uses the quoted-string form so that the space character
320  can be included.
321</postamble>
322</figure>
323<figure>
324<preamble>
325Direct UA to show "save as" dialog, with a filename containing the Unicode character  U+20AC (EURO SIGN):
326</preamble>
327<artwork type="example"><![CDATA[
328  Content-Disposition: attachment;
329                       filename*= UTF-8''%e2%82%ac%20rates
330  ]]></artwork>
331<postamble>
332  Here, the encoding defined in <xref target="RFC5987"/> is also used to encode the
333  non-ISO-8859-1 character.
334</postamble>
335</figure>
336<figure>
337<preamble>
338Same as above, but adding the "filename" parameter for compatibility with
339user agents not implementing RFC 5987:
340</preamble>
341<artwork type="example"><![CDATA[
342  Content-Disposition: attachment;
343                       filename="EURO rates";
344                       filename*=utf-8''%e2%82%ac%20rates
345  ]]></artwork>
346<postamble>
347  Note: those user agents that do not support the RFC 5987 encoding ignore
348  "filename*" when it occurs after "filename".
349</postamble>
350</figure>
351
352</section>
353
354<section title="Internationalization Considerations" anchor="i18n">
355<t>
356  The "filename*" parameter (<xref target="disposition.parameter.filename"/>),
357  using the encoding defined in <xref target="RFC5987"/>, allows the
358  server to transmit characters outside the ISO-8859-1 character set,
359  and also to optionally specify the language in use.
360</t>
361<t>
362  Future parameters might also require internationalization, in which case
363  the same encoding can be used.
364</t>
365</section>
366
367<section title="Security Considerations" anchor="security.considerations">
368<t>
369  Using server-supplied information for constructing local filenames introduces
370  many risks. These are summarized in <xref target="disposition.parameter.filename"/>.
371</t>
372<t>
373  Furthermore, implementers also ought to be aware of the Security
374  Considerations applying to HTTP (see Section 15 of <xref target="RFC2616"/>), and also the parameter encoding defined in <xref target="RFC5987"/>
375  (see Section 5).
376</t>
377</section> 
378
379<section title="IANA Considerations" anchor="iana.considerations">
380
381<section title="Registry for Disposition Values and Parameter" anchor="registry">
382<t>
383  This specification does not introduce any changes to the registration
384  procedures for disposition values and parameters that are defined in
385  Section 9 of <xref target="RFC2183"/>.
386</t>
387</section>
388
389<section title="Header Field Registration" anchor="header.field.registration"> 
390<t>
391  This document updates the definition of the Content-Disposition HTTP header field
392  in the permanent HTTP header field registry (see <xref target="RFC3864"/>).
393</t>
394<t>
395<list style="hanging">
396  <t hangText="Header field name:">Content-Disposition</t>
397  <t hangText="Applicable protocol:">http</t>
398  <t hangText="Status:">standard</t>
399  <t hangText="Author/Change controller:">IETF</t>
400  <t hangText="Specification document:">this specification (<xref target="header.field.definition"/>)</t>
401  <t hangText="Related information:">none</t>
402</list>
403</t>
404</section>
405
406</section> 
407
408<section title="Acknowledgements">
409<t>
410  Thanks to
411  Adam Barth,
412  Rolf Eike Beer,
413  Stewart Bryant,
414  Bjoern Hoehrmann,
415  Alfred Hoenes,
416  Roar Lauritzsen,
417  Alexey Melnikov,
418  Henrik Nordstrom, and
419  Mark Nottingham for
420  their valuable feedback.
421</t>
422</section> 
423
424  </middle>
425  <back>
426 
427<references title="Normative References">
428 
429  <reference anchor="RFC2119">
430    <front>
431      <title abbrev="RFC Key Words">Key words for use in RFCs to Indicate Requirement Levels</title>
432      <author initials="S." surname="Bradner" fullname="Scott Bradner">
433        <organization>Harvard University</organization>
434        <address><email>sob@harvard.edu</email></address>
435      </author>
436      <date month="March" year="1997"/>
437      <area>General</area>
438      <keyword>keyword</keyword>
439    </front>
440    <seriesInfo name="BCP" value="14"/>
441    <seriesInfo name="RFC" value="2119"/>
442  </reference>
443
444  <reference anchor="RFC2616">
445    <front>
446      <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
447      <author initials="R." surname="Fielding" fullname="R. Fielding">
448        <organization>University of California, Irvine</organization>
449        <address><email>fielding@ics.uci.edu</email></address>
450      </author>
451      <author initials="J." surname="Gettys" fullname="J. Gettys">
452        <organization>W3C</organization>
453        <address><email>jg@w3.org</email></address>
454      </author>
455      <author initials="J." surname="Mogul" fullname="J. Mogul">
456        <organization>Compaq Computer Corporation</organization>
457        <address><email>mogul@wrl.dec.com</email></address>
458      </author>
459      <author initials="H." surname="Frystyk" fullname="H. Frystyk">
460        <organization>MIT Laboratory for Computer Science</organization>
461        <address><email>frystyk@w3.org</email></address>
462      </author>
463      <author initials="L." surname="Masinter" fullname="L. Masinter">
464        <organization>Xerox Corporation</organization>
465        <address><email>masinter@parc.xerox.com</email></address>
466      </author>
467      <author initials="P." surname="Leach" fullname="P. Leach">
468        <organization>Microsoft Corporation</organization>
469        <address><email>paulle@microsoft.com</email></address>
470      </author>
471      <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
472        <organization>W3C</organization>
473        <address><email>timbl@w3.org</email></address>
474      </author>
475      <date month="June" year="1999"/>
476    </front>
477    <seriesInfo name="RFC" value="2616"/>
478  </reference>
479
480  <reference anchor="RFC5987">
481        <front>
482      <title>Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters</title>
483      <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke">
484        <organization abbrev="greenbytes">greenbytes GmbH</organization>
485        <address>
486          <postal>
487            <street>Hafenweg 16</street>
488            <city>Muenster</city><region>NW</region><code>48155</code>
489            <country>Germany</country>
490          </postal>
491          <email>julian.reschke@greenbytes.de</email>   
492          <uri>http://greenbytes.de/tech/webdav/</uri> 
493        </address>
494      </author>
495      <date month="August" year="2010"/>
496    </front>
497    <seriesInfo name="RFC" value="5987"/>
498  </reference>
499
500  <reference anchor="ISO-8859-1">
501    <front>
502      <title>Information technology -- 8-bit single-byte coded graphic character sets -- Part 1: Latin alphabet No. 1</title>
503      <author>
504        <organization>International Organization for Standardization</organization>
505      </author>
506      <date year="1998"/>
507    </front>
508    <seriesInfo name="ISO/IEC" value="8859-1:1998"/>
509  </reference>
510
511</references>
512 
513<references title="Informative References">
514
515  <reference anchor="RFC2046">
516    <front>
517      <title abbrev="Media Types">Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types</title>
518      <author initials="N." surname="Freed" fullname="Ned Freed">
519        <organization>Innosoft International, Inc.</organization>
520        <address><email>ned@innosoft.com</email></address>
521      </author>
522      <author initials="N." surname="Borenstein" fullname="Nathaniel S. Borenstein">
523        <organization>First Virtual Holdings</organization>
524        <address><email>nsb@nsb.fv.com</email></address>
525      </author>
526      <date month="November" year="1996"/>
527    </front>
528    <seriesInfo name="RFC" value="2046"/>
529  </reference>
530
531  <reference anchor="RFC2047">
532    <front>
533      <title abbrev="Message Header Extensions">MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text</title>
534      <author initials="K." surname="Moore" fullname="Keith Moore">
535        <organization>University of Tennessee</organization>
536        <address><email>moore@cs.utk.edu</email></address>
537      </author>
538      <date month="November" year="1996"/>
539    </front>
540    <seriesInfo name="RFC" value="2047"/>
541  </reference>
542
543  <reference anchor="RFC2183">
544    <front>
545      <title abbrev="Content-Disposition">Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field</title>
546      <author initials="R." surname="Troost" fullname="Rens Troost">
547        <organization>New Century Systems</organization>
548        <address><email>rens@century.com</email></address>
549      </author>
550      <author initials="S." surname="Dorner" fullname="Steve Dorner">
551        <organization>QUALCOMM Incorporated</organization>
552        <address><email>sdorner@qualcomm.com</email></address>
553      </author>
554      <author initials="K." surname="Moore" fullname="Keith Moore">
555        <organization>Department of Computer Science</organization>
556        <address><email>moore@cs.utk.edu</email></address>
557      </author>
558      <date year="1997" month="August"/>
559    </front>
560    <seriesInfo name="RFC" value="2183"/>
561  </reference>
562
563  <reference anchor="RFC2231">
564    <front>
565      <title abbrev="MIME Value and Encoded Word Extensions">MIME Parameter Value and Encoded Word Extensions: Character Sets, Languages, and Continuations</title>
566      <author initials="N." surname="Freed" fullname="Ned Freed">
567        <organization abbrev="Innosoft">Innosoft International, Inc.</organization>
568        <address><email>ned.freed@innosoft.com</email></address>
569      </author>
570      <author initials="K." surname="Moore" fullname="Keith Moore">
571        <organization>University of Tennessee</organization>
572        <address><email>moore@cs.utk.edu</email></address>
573      </author>
574      <date year="1997" month="November"/>
575    </front>
576    <seriesInfo name="RFC" value="2231"/>
577  </reference>
578
579  <reference anchor="RFC2388">
580    <front>
581      <title abbrev="multipart/form-data">Returning Values from Forms: multipart/form-data</title>
582      <author initials="L." surname="Masinter" fullname="Larry Masinter">
583        <organization>Xerox Palo Alto Research Center</organization>
584        <address>
585          <email>masinter@parc.xerox.com</email>
586        </address>
587      </author>
588      <date year="1998" month="August"/>
589    </front>
590    <seriesInfo name="RFC" value="2388"/>
591  </reference>
592<!--
593  <reference anchor="RFC3629">
594    <front>
595      <title>UTF-8, a transformation format of ISO 10646</title>
596      <author initials="F." surname="Yergeau" fullname="F. Yergeau">
597        <organization>Alis Technologies</organization>
598        <address><email>fyergeau@alis.com</email></address>
599      </author>
600      <date month="November" year="2003"/>
601    </front>
602    <seriesInfo name="STD" value="63"/>
603    <seriesInfo name="RFC" value="3629"/>
604  </reference>-->
605
606  <reference anchor="RFC3864">
607    <front>
608      <title>Registration Procedures for Message Header Fields</title>
609      <author initials="G." surname="Klyne" fullname="G. Klyne">
610        <organization>Nine by Nine</organization>
611        <address><email>GK-IETF@ninebynine.org</email></address>
612      </author>
613      <author initials="M." surname="Nottingham" fullname="M. Nottingham">
614        <organization>BEA Systems</organization>
615        <address><email>mnot@pobox.com</email></address>
616      </author>
617      <author initials="J." surname="Mogul" fullname="J. Mogul">
618        <organization>HP Labs</organization>
619        <address><email>JeffMogul@acm.org</email></address>
620      </author>
621      <date year="2004" month="September"/>
622    </front>
623    <seriesInfo name="BCP" value="90"/>
624    <seriesInfo name="RFC" value="3864"/>
625  </reference>
626
627  <reference anchor="RFC3986">
628   <front>
629    <title abbrev="URI Generic Syntax">Uniform Resource Identifier (URI): Generic Syntax</title>
630    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
631      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
632      <address>
633         <email>timbl@w3.org</email>
634         <uri>http://www.w3.org/People/Berners-Lee/</uri>
635      </address>
636    </author>
637    <author initials="R." surname="Fielding" fullname="Roy T. Fielding">
638      <organization abbrev="Day Software">Day Software</organization>
639      <address>
640        <email>fielding@gbiv.com</email>
641        <uri>http://roy.gbiv.com/</uri>
642      </address>
643    </author>
644    <author initials="L." surname="Masinter" fullname="Larry Masinter">
645      <organization abbrev="Adobe Systems">Adobe Systems Incorporated</organization>
646      <address>
647        <email>LMM@acm.org</email>
648        <uri>http://larry.masinter.net/</uri>
649      </address>
650    </author>
651    <date month="January" year="2005"/>
652   </front>
653   <seriesInfo name="STD" value="66"/>
654   <seriesInfo name="RFC" value="3986"/>
655  </reference>
656
657   <reference anchor="US-ASCII">
658    <front>
659      <title>Coded Character Set -- 7-bit American Standard Code for Information Interchange</title>
660      <author>
661        <organization>American National Standards Institute</organization>
662      </author>
663      <date year="1986"/>
664    </front>
665    <seriesInfo name="ANSI" value="X3.4"/>
666   </reference>
667
668</references>
669
670<section title="Changes from the RFC 2616 Definition" anchor="changes.from.rfc2616">
671<t>
672  Compared to Section 19.5.1 of <xref target="RFC2616"/>, the following
673  normative changes reflecting actual implementations have been made:
674<list style="symbols">
675  <t>
676    According to RFC 2616, the disposition type "attachment" only applies to
677    content of type "application/octet-stream". This restriction has been
678    removed, because recipients in practice do not check the content type, and
679    it also discourages properly declaring the media type.
680  </t>
681  <t>
682    RFC 2616 only allows "quoted-string" for the filename parameter. This
683    would be an exceptional parameter syntax, and also doesn't reflect actual
684    use.
685  </t>
686  <t>
687    The definition for the disposition type "inline" (<xref target="RFC2183"/>, Section 2.1)
688    has been re-added with a suggestion for its processing.
689  </t>
690  <t>
691    This specification requires support for the extended parameter encoding
692    defined in <xref target="RFC5987"/>.
693  </t>
694</list>
695</t>
696</section>
697
698<section title="Differences compared to RFC 2183" anchor="diffs.compared.to.rfc2183">
699<t>
700  Section 2 of <xref target="RFC2183"/> defines several additional
701  disposition parameters: "creation-date", "modification-date",
702  "quoted-date-time", and "size". The majority of user agents does not implement
703  these, thus they have been omitted from this specification.
704</t>
705</section>
706
707<section title="Alternative Approaches to Internationalization" anchor="alternatives">
708<t>
709  By default, HTTP header field parameters cannot carry characters outside
710  the ISO-8859-1 (<xref target="ISO-8859-1"/>) character encoding (see
711  <xref target="RFC2616"/>, Section 2.2). For the "filename"
712  parameter, this of course is an unacceptable restriction.
713</t>
714<t>
715  Unfortunately, user agent implementers have not managed to come up with
716  an interoperable approach, although the IETF Standards Track specifies
717  exactly one solution (<xref target="RFC2231"/>, clarified and profiled for
718  HTTP in <xref target="RFC5987"/>).
719</t>
720<t>
721  For completeness, the sections below describe the various approaches that
722  have been tried, and explains how they are inferior to the RFC 5987
723  encoding used in this specification.
724</t>
725
726<section title="RFC 2047 Encoding" anchor="alternatives.rfc2047">
727<t>
728  RFC 2047 defines an encoding mechanism for
729  header fields, but this encoding is not supposed to be used for
730  header field parameters - see Section 5 of <xref target="RFC2047"/>: 
731</t>
732<t><list>
733  <t>
734    An 'encoded-word' MUST NOT appear within a 'quoted-string'.
735  </t>
736  <t>
737    ...
738  </t>
739  <t>
740    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'.
741  </t>
742</list></t>
743<t>
744  In practice, some user agents implement the encoding, some do not
745  (exposing the encoded string to the user), and some get confused by it.
746</t>
747</section>
748
749<section title="Percent Encoding" anchor="alternatives.percent">
750<t>
751  Some user agents accept percent encoded (<xref target="RFC3986"/>, Section 2.1)
752  sequences of characters. The character encoding being used for decoding
753  depends on various factors, including the encoding of the referring page,
754  the user agent's locale, its configuration, and also the actual value of
755  the parameter.
756</t>
757<t>
758  In practice, this is hard to use because those user agents that do not
759  support it will display the escaped character sequence to the user. For those
760  user agents that do implement this it is difficult to predict what character
761  encoding they actually expect.
762</t>
763</section>
764
765<section title="Encoding Sniffing" anchor="alternatives.sniff">
766<t>
767  Some user agents inspect the value (which defaults to ISO-8859-1 for the
768  quoted-string form) and switch to UTF-8 when it seems to be more likely to be
769  the correct interpretation.
770</t>
771<t>
772  As with the approaches above, this is not interoperable and furthermore
773  risks misinterpreting the actual value.
774</t>
775</section>
776
777<section title="Implementations (to be removed by RFC Editor before publication)" anchor="alternatives.implementations">
778<t>
779  Unfortunately, as of March 2011, neither the encoding defined in RFCs 2231
780  and 5987, nor any of the alternate approaches discussed above was
781  implemented interoperably. Thus, this specification recommends the approach
782  defined in RFC 5987, which at least has the advantage of actually being
783  specified properly.
784</t>
785<t>
786  The table below shows the support for the various approaches in the current
787  implementations:
788</t>
789<texttable align="left">
790  <ttcol>User Agent</ttcol>
791  <ttcol>RFC 2231/5987</ttcol>
792  <ttcol>RFC 2047</ttcol>
793  <ttcol>Percent Encoding</ttcol>
794  <ttcol>Encoding Sniffing</ttcol>
795 
796  <c>Chrome</c>
797  <c>yes</c>
798  <c>yes</c>
799  <c>yes</c>
800  <c>yes</c>
801
802  <c>Firefox</c>
803  <c>yes (*)</c>
804  <c>yes</c>
805  <c>no</c>
806  <c>yes</c>
807
808  <c>Internet Explorer</c>
809  <c>yes (**)</c>
810  <c>no</c>
811  <c>yes</c>
812  <c>no</c>
813
814  <c>Konqueror</c>
815  <c>yes</c>
816  <c>no</c>
817  <c>no</c>
818  <c>no</c>
819
820  <c>Opera</c>
821  <c>yes</c>
822  <c>no</c>
823  <c>no</c>
824  <c>no</c>
825
826  <c>Safari</c>
827  <c>no</c>
828  <c>no</c>
829  <c>no</c>
830  <c>yes</c>
831</texttable>
832
833<t>
834  (*) Does not implement the fallback behavior to "filename" described in
835  <xref target="disposition.parameter.filename"/>; a fix is planned for Firefox 5.
836</t>
837<t>
838  (**) Starting with Internet Explorer 9, but only implements UTF-8.
839</t>
840
841</section>
842
843</section>
844
845<section title="Advice on Generating Content-Disposition Header Fields" anchor="advice.generating">
846<t>
847  To successfully interoperate with existing and future user agents, senders of
848  the Content-Disposition header field are advised to:
849</t>
850<t>
851  <list style="symbols">
852    <t>Include a "filename" parameter when US-ASCII (<xref target="US-ASCII"/>) is sufficiently
853    expressive.</t>
854    <t>Use the 'token' form of the filename parameter only when it does not
855    contain disallowed characters (e.g., spaces); in such cases, the
856    quoted-string form should be used.</t>
857    <t>Avoid including the percent character followed by two hexadecimal
858    characters (e.g., %A9) in the filename parameter, since some existing
859    implementations consider it to be an escape character, while others will
860    pass it through unchanged.</t>
861    <t>Avoid including the "\" character in the quoted-string form of the
862    filename parameter, as escaping is not implemented by some user agents,
863    and can be considered as an illegal path character.</t>
864    <t>Avoid using non-ASCII characters in the filename parameter. Although
865    most existing implementations will decode them as ISO-8859-1, some
866    will apply heuristics to detect UTF-8, and thus might fail on certain names.</t>
867    <t>Include a "filename*" parameter where the desired filename cannot be
868    expressed faithfully using the "filename" form. Note that legacy user
869    agents will not process this, and will fall back to using the "filename"
870    parameter's content.
871    </t>
872    <t>When a "filename*" parameter is sent, to also generate a "filename"
873    parameter as a fallback for user agents that do not support the "filename*"
874    form, if possible. This can be done by substituting characters with
875    US-ASCII sequences (e.g., Unicode character point U+00E4 (LATIN SMALL
876    LETTER A WITH DIARESIS) by "ae"). Note that this may not be possible in
877    some locales.
878    </t>
879    <t>When a "filename" parameter is included as a fallback (as per above),
880    "filename" should occur first, due to parsing problems in some existing
881    implementations.
882    <cref anchor="fallbackbug" source="jre">
883    Firefox is known to pick the wrong parameter; a bug fix is scheduled for
884    Firefox 5.</cref>
885    <cref anchor="NOTE-TO-RFC-EDITOR" source="jre">
886    PLEASE REMOVE THIS AND THE PRECEDING COMMENT BEFORE PUBLICATION AS RFC.</cref>
887    </t>
888    <t>Use UTF-8 as the encoding of the "filename*" parameter, when present,
889    because at least one existing implementation only implements that encoding.</t>
890  </list>
891</t>
892<t>
893  Note that this advice is based upon UA behaviour at the time of writing, and
894  might be superseded. At the time of publication of this document,
895  <eref target="http://purl.org/NET/http/content-disposition-tests"/> provides
896  an overview of current levels of support in various implementations.
897</t>
898</section>
899
900<section title="Change Log (to be removed by RFC Editor before publication)" anchor="change.log">
901<t>
902  Note: the issues names in the change log entries for draft-reschke-rfc2183-in-http
903  refer to <eref target="http://greenbytes.de/tech/webdav/draft-reschke-rfc2183-in-http-issues.html"/>.
904</t>
905
906<section title="Since draft-reschke-rfc2183-in-http-00">
907<t> 
908  Adjust terminology ("header" -&gt; "header field").
909  Update rfc2231-in-http reference.
910</t>
911</section>
912
913<section title="Since draft-reschke-rfc2183-in-http-01">
914<t> 
915  Update rfc2231-in-http reference. Actually define the "filename"
916  parameter. Add internationalization considerations.
917  Add examples using the RFC 5987 encoding.
918  Add overview over other approaches, plus a table reporting
919  implementation status.
920  Add and resolve issue "nodep2183".
921  Add issues "asciivsiso",
922  "deplboth", "quoted", and "registry".
923</t>
924</section>
925
926<section title="Since draft-reschke-rfc2183-in-http-02">
927<t>
928  Add and close issue "docfallback".
929  Close issues "asciivsiso", "deplboth", "quoted", and
930  "registry".
931</t>
932</section>
933
934<section title="Since draft-reschke-rfc2183-in-http-03">
935<t>
936  Updated to be a Working Draft of the IETF HTTPbis Working Group.
937</t>
938</section>
939
940<section title="Since draft-ietf-httpbis-content-disp-00" anchor="changes.since.00">
941<t>
942  Closed issues:
943  <list style="symbols">
944    <t>
945      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/242"/>:
946      "handling of unknown disposition types"
947    </t>
948  </list>
949</t>
950<t>
951  Slightly updated the notes about the proposed fallback behavior.
952</t>
953</section>
954
955<section title="Since draft-ietf-httpbis-content-disp-01" anchor="changes.since.01">
956<t>
957  Various editorial improvements.
958</t>
959</section>
960
961<section title="Since draft-ietf-httpbis-content-disp-02" anchor="changes.since.02">
962<t>
963  Closed issues:
964  <list style="symbols">
965    <t>
966      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/244"/>:
967      "state that repeating parameters are invalid"
968    </t>
969    <t>
970      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/245"/>:
971      "warn about %xx in filenames being misinterpreted"
972    </t>
973    <t>
974      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/246"/>:
975      "mention control chars when talking about postprecessing the filename parameter"
976    </t>
977  </list>
978</t>
979<t>
980  Update <xref target="alternatives.implementations"/>; Opera 10.63 RC
981  implements the recommended fallback behavior.
982</t>
983</section>
984
985<section title="Since draft-ietf-httpbis-content-disp-03" anchor="changes.since.03">
986<t>
987  Closed issues:
988  <list style="symbols">
989    <t>
990      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/252"/>:
991      "'modification-date' *is* implemented in Konq 4.5"
992    </t>
993    <t>
994      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/253"/>:
995      "clarify what LWS means for the Content-Disp grammar"
996    </t>
997    <t>
998      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/258"/>:
999      "Avoid passive voice in message requirements"
1000    </t>
1001    <t>
1002      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/263"/>:
1003      "text about historical percent-decoding unclear"
1004    </t>
1005    <t>
1006      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/264"/>:
1007      "add explanation of language tagging"
1008    </t>
1009    <t>
1010      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/265"/>:
1011      "Clarify that C-D spec does not apply to multipart upload"
1012    </t>
1013  </list>
1014</t>
1015</section>
1016
1017<section title="Since draft-ietf-httpbis-content-disp-04" anchor="changes.since.04">
1018<t>
1019  Updated implementation information (Chrome 9 implements RFC 5987, IE 9 RC implements
1020  it for UTF-8 only).
1021</t>
1022<t>
1023  Clarify who requirements are on, add a section discussing conformance
1024  and handling of invalid field values in general.
1025</t>
1026<t>
1027  Closed issues:
1028  <list style="symbols">
1029     <t>
1030      <eref target="http://trac.tools.ietf.org/wg/httpbis/trac/ticket/243"/>:
1031      "avoid stating ISO-8859-1 default for header param" (the default
1032      is still mentioned, but it was clarified what it applies to).
1033    </t>
1034   <t>
1035      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/272"/>:
1036      "Path Separator Characters"
1037    </t>
1038  </list>
1039</t>
1040</section>
1041
1042<section title="Since draft-ietf-httpbis-content-disp-05" anchor="changes.since.05">
1043<t>
1044  Editorial changes:
1045  Fixed two typos where the new Conformance section said "Content-Location" instead
1046  of "Content-Disposition". Cleaned up terminology ("user agent", "recipient",
1047  "sender", "message body", ...). Stated what the escape character for quoted-string
1048  is. Explained a use case for "inline" disposition type. Updated implementation
1049  notes with respect to the fallback behavior.
1050</t>
1051<t>
1052  Added appendix "Advice on Generating Content-Disposition Header Fields".
1053</t>
1054</section>
1055
1056<section title="Since draft-ietf-httpbis-content-disp-06" anchor="changes.since.06">
1057<t>
1058  Closed issues:
1059  <list style="symbols">
1060     <t>
1061      <eref target="http://trac.tools.ietf.org/wg/httpbis/trac/ticket/278"/>:
1062      "conformance language"
1063    </t>
1064  </list>
1065</t>
1066</section>
1067
1068<section title="Since draft-ietf-httpbis-content-disp-07" anchor="changes.since.07">
1069<t>
1070  Rephrase the requirement about well-known file system locations, and also
1071  clarify that by "last path segment" we mean the actual filename.
1072  Added a forward reference from "invalid" to the section that defines a valid
1073  header field.
1074</t>
1075</section>
1076
1077<section title="Since draft-ietf-httpbis-content-disp-08" anchor="changes.since.08">
1078<t>
1079  Update: Internet Explorer 9 is released.
1080  Various editorial improvements.
1081  Add US-ASCII reference.
1082  Strengthen file extension handling requirement to MUST for those recipients
1083  that actually use file extensions to map media types.
1084</t>
1085</section>
1086
1087</section>
1088
1089
1090  </back>
1091
1092</rfc>
Note: See TracBrowser for help on using the repository browser.