source: draft-ietf-httpbis-content-disp/06/draft-ietf-httpbis-content-disp-06.xml

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

fix mime types

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