source: draft-ietf-httpbis-content-disp/07/draft-ietf-httpbis-content-disp-07.xml @ 1197

Last change on this file since 1197 was 1181, checked in by julian.reschke@…, 10 years ago

Content-Disposition draft 07

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