source: draft-ietf-httpbis-content-disp/08/draft-ietf-httpbis-content-disp-08.xml @ 2684

Last change on this file since 2684 was 1500, checked in by julian.reschke@…, 9 years ago

fix mime types

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