source: draft-ietf-httpbis-content-disp/latest/draft-ietf-httpbis-content-disp.xml @ 1201

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

complete header field reg template

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