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

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

Resolve issue #246: mention the dangers of control characters

  • Property svn:executable set to *
File size: 31.5 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="October" year="2010"/>
45  <workgroup>HTTPbis Working Group</workgroup>
46 
47  <abstract>
48    <t>
49      HTTP/1.1 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.02"/>.
72    </t>
73  </note>
74  </front>
75
76  <middle>
77
78<section title="Introduction" anchor="introduction">
79<t>
80  HTTP/1.1 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</section> 
99
100<section title="Notational Conventions">
101<t>
102  The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
103  "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document
104  are to be interpreted as described in <xref target="RFC2119"/>.
105</t>
106<t>
107  This specification uses the augmented BNF notation defined in
108  <xref target="RFC2616" x:fmt="of" x:sec="2.1"/>, including its rules for
109  linear whitespace (LWS).
110</t>
111</section> 
112
113<section title="Header Field Definition" anchor="header.field.definition">
114  <iref item="Headers" subitem="Content-Disposition" primary="true" x:for-anchor=""/>
115  <iref item="Content-Disposition header" primary="true" x:for-anchor=""/>
116<t>
117  The Content-Disposition response header field is used to convey additional
118  information about how to process the response payload, and also can be used
119  to attach additional metadata, such as the filename to use when saving the
120  response payload locally.
121</t>
122
123<section title="Grammar">
124<figure><artwork type="abnf2616">
125  content-disposition = "Content-Disposition" ":"
126                         disposition-type *( ";" disposition-parm )
127
128  disposition-type    = "inline" | "attachment" | disp-ext-type
129                      ; case-insensitive
130  disp-ext-type       = token
131
132  disposition-parm    = filename-parm | disp-ext-parm
133
134  filename-parm       = "filename" "=" value
135                      | "filename*" "=" ext-value
136 
137  disp-ext-parm       = token "=" value
138                      | ext-token "=" ext-value
139  ext-token           = &lt;the characters in token, followed by "*"&gt;
140</artwork></figure>
141
142<figure>
143<preamble>Defined in <xref target="RFC2616"/>:</preamble>
144<artwork type="abnf2616">
145  token       = &lt;token, defined in <xref target="RFC2616" x:fmt="," x:sec="2.2"/>&gt;
146  value       = &lt;value, defined in <xref target="RFC2616" x:fmt="," x:sec="3.6"/>&gt;
147</artwork></figure>
148<figure>
149<preamble>Defined in <xref target="RFC5987"/>:</preamble>
150<artwork type="abnf2616">
151  ext-value   = &lt;ext-value, defined in <xref target="RFC5987" x:sec="3.2"/>&gt;
152</artwork></figure>
153</section>
154
155<section title="Disposition Type" anchor="disposition.type">
156<t>
157  If the disposition type matches "attachment" (case-insensitively), this
158  indicates that the user agent should prompt the user to save the response
159  locally, rather than process it normally (as per its media type).
160</t>
161<t>
162  On the other hand, if it matches "inline" (case-insensitively), this implies
163  default processing.
164</t>
165<t>
166  Unknown or unhandled disposition types &SHOULD; be handled the same way as
167  "attachment" (see also <xref target="RFC2183" x:fmt="," x:sec="2.8"/>).
168</t>
169</section>
170
171<section title="Disposition Parameter: 'Filename'" anchor="disposition.parameter.filename">
172<t>
173  The parameters "filename" and "filename*", to be matched case-insensitively,
174  provide information on how to construct a filename for storing the message
175  payload.
176</t>
177<t>
178  Depending on the disposition type, this information might be used right away
179  (in the "save as..." interaction caused for the "attachment" disposition type),
180  or later on (for instance, when the user decides to save the contents of the
181  current page being displayed).
182</t>
183<t>
184  The parameters "filename" and "filename*" differ only in that "filename*" uses
185  the encoding defined in <xref target="RFC5987"/>, allowing the use
186  of characters not present in the ISO-8859-1 character set (<xref target="ISO-8859-1"/>).
187</t>
188<t>
189  Many user agent implementations predating this specification
190  do not understand the "filename*" parameter. Therefore, when both "filename"
191  and "filename*" are present in a single header field value, recipients
192  &SHOULD; pick "filename*" and ignore "filename". This way, senders
193  can avoid special-casing specific user agents by sending both the
194  more expressive "filename*" parameter, and the "filename" parameter
195  as fallback for legacy recipients (see <xref target="examples"/> for
196  an example).
197</t>
198<t>
199  It is essential that user agents treat the specified filename as advisory
200  only, thus be very careful in extracting the desired information.
201  In particular:
202  <list style="symbols">
203    <x:lt><t>
204      When the value contains path separator characters, all but the last
205      segment &SHOULD; be ignored. This prevents unintentional overwriting
206      of well-known file system location (such as "/etc/passwd").
207    </t></x:lt>
208    <x:lt><t>
209      Many platforms do not use Internet Media Types (<xref target="RFC2046"/>)
210      to hold type information in the file system, but rely on filename
211      extensions instead. Trusting the server-provided file extension could
212      introduce a privilege escalation when the saved file is later opened
213      (consider ".exe"). Thus, recipients need to ensure that a file extension
214      is used that is safe, optimally matching the media type of the received
215      payload.
216    </t></x:lt>
217    <x:lt><t>
218      Recipients are advised to strip or replace character sequences that are
219      known to cause confusion both in user interfaces and in filenames, such as
220      control characters and leading and trailing whitespace.
221    </t></x:lt>
222    <x:lt><t>
223      Other aspects recipients need to be aware of are names that have a
224      special meaning in the file system or in shell commands, such as "." and "..",
225      "~", "|", and also device names.
226    </t></x:lt>
227  </list>
228</t>
229</section>
230
231<section title="Disposition Parameter: Extensions" anchor="disposition.parameter.extensions">
232<t>
233  To enable future extensions, unknown parameters &SHOULD; be ignored (see also <xref target="RFC2183" x:fmt="," x:sec="2.8"/>).
234</t>
235</section>
236
237<section title="Extensibility" anchor="extensibility">
238<t>
239  Note that <xref target="RFC2183" x:fmt="of" x:sec="9"/> defines IANA registries both
240  for disposition types and disposition parameters. This registry is
241  shared by different protocols using Content-Disposition, such as MIME and HTTP.
242  Therefore, not all registered values may make sense in the context of HTTP.
243</t>
244</section>
245
246</section> 
247
248<section title="Examples" anchor="examples">
249
250<figure>
251<preamble>
252Direct UA to show "save as" dialog, with a filename of "example.html": 
253</preamble>
254<artwork type="example">
255Content-Disposition: Attachment; filename=example.html
256</artwork></figure>
257<figure>
258<preamble>
259Direct UA to behave as if the Content-Disposition header field wasn't present,
260but to remember the filename "example.html" for a subsequent save operation:
261</preamble>
262<artwork type="example" x:indent-with="  ">
263Content-Disposition: INLINE; FILENAME= "example.html"
264</artwork></figure>
265<figure>
266<preamble>
267Direct UA to show "save as" dialog, with a filename of "an example":
268</preamble>
269<artwork type="example">
270Content-Disposition: Attachment; Filename*=UTF-8'<x:highlight>en</x:highlight>'an<x:highlight>%20</x:highlight>example
271</artwork>
272<postamble>Note that this example uses the extended encoding defined in
273<xref target="RFC5987"/> to specify that the natural language of the filename
274is English, and also to encode the space character which is not allowed in the
275token production.
276</postamble>
277</figure>
278<figure>
279<preamble>
280Direct UA to show "save as" dialog, with a filename containing the Unicode character  U+20AC (EURO SIGN):
281</preamble>
282<artwork type="example" x:indent-with="  ">
283Content-Disposition: attachment;
284                     filename*= UTF-8''<x:highlight>%e2%82%ac</x:highlight>%20rates
285</artwork>
286<postamble>
287  Here, the encoding defined in <xref target="RFC5987"/> is also used to encode the
288  non-ISO-8859-1 character.
289</postamble>
290</figure>
291<figure>
292<preamble>
293Same as above, but adding the "filename" parameter for compatibility with
294user agents not implementing RFC 5987:
295</preamble>
296<artwork type="example" x:indent-with="  ">
297Content-Disposition: attachment;
298                     filename="EURO rates";
299                     filename*=utf-8''<x:highlight>%e2%82%ac</x:highlight>%20rates
300</artwork>
301<postamble>
302  Note: as of September 2010, those user agents that do not support the RFC 5987
303  encoding ignore "filename*" when it occurs after "filename". Unfortunately,
304  some user agents that do support RFC 5987 do pick the "filename" rather
305  than the "filename*" parameter when it occurs first; it is expected that
306  this situation is going to improve soon.
307</postamble>
308</figure>
309
310</section>
311
312<section title="Internationalization Considerations" anchor="i18n">
313<t>
314  The "filename*" parameter (<xref target="disposition.parameter.filename"/>),
315  using the encoding defined in <xref target="RFC5987"/>, allows the
316  server to transmit characters outside the ISO-8859-1 character set,
317  and also to optionally specify the language in use.
318</t>
319<t>
320  Future parameters might also require internationalization, in which case
321  the same encoding can be used.
322</t>
323</section>
324
325<section title="Security Considerations" anchor="security.considerations">
326<t>
327  Using server-supplied information for constructing local filenames introduces
328  many risks. These are summarized in <xref target="disposition.parameter.filename"/>.
329</t>
330<t>
331  Furthermore, implementers also ought to be aware of the Security
332  Considerations applying to HTTP (see <xref target="RFC2616" x:fmt="of" x:sec="15"/>), and also the parameter encoding defined in <xref target="RFC5987"/>
333  (see <xref target="RFC5987" x:fmt="sec" x:sec="5"/>).
334</t>
335</section> 
336
337<section title="IANA Considerations" anchor="iana.considerations">
338
339<section title="Registry for Disposition Values and Parameter" anchor="registry">
340<t>
341  This specification does not introduce any changes to the registration
342  procedures for disposition values and parameters that are defined in
343  <xref target="RFC2183" x:fmt="of" x:sec="9"/>.
344</t>
345</section>
346
347<section title="Header Field Registration" anchor="header.field.registration"> 
348<t>
349  This document updates the definition of the Content-Disposition HTTP header field
350  in the permanent HTTP header field registry (see <xref target="RFC3864"/>).
351</t>
352<t>
353<list style="hanging">
354  <t hangText="Header field name:">Content-Disposition</t>
355  <t hangText="Applicable protocol:">http</t>
356  <t hangText="Status:">standard</t>
357  <t hangText="Author/Change controller:">IETF</t>
358  <t hangText="Specification document:">this specification (<xref target="header.field.definition"/>)</t>
359</list>
360</t>
361</section>
362
363</section> 
364
365<section title="Acknowledgements">
366<t>
367  Thanks to Adam Barth, Rolf Eike Beer, Bjoern Hoehrmann, Alfred Hoenes, Roar Lauritzsen,
368  Henrik Nordstrom, and Mark Nottingham for their valuable feedback.
369</t>
370</section> 
371
372  </middle>
373  <back>
374 
375<references title="Normative References">
376 
377  <reference anchor="RFC2119">
378    <front>
379      <title abbrev="RFC Key Words">Key words for use in RFCs to Indicate Requirement Levels</title>
380      <author initials="S." surname="Bradner" fullname="Scott Bradner">
381        <organization>Harvard University</organization>
382        <address><email>sob@harvard.edu</email></address>
383      </author>
384      <date month="March" year="1997"/>
385      <area>General</area>
386      <keyword>keyword</keyword>
387    </front>
388    <seriesInfo name="BCP" value="14"/>
389    <seriesInfo name="RFC" value="2119"/>
390  </reference>
391
392  <reference anchor="RFC2616">
393    <front>
394      <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
395      <author initials="R." surname="Fielding" fullname="R. Fielding">
396        <organization>University of California, Irvine</organization>
397        <address><email>fielding@ics.uci.edu</email></address>
398      </author>
399      <author initials="J." surname="Gettys" fullname="J. Gettys">
400        <organization>W3C</organization>
401        <address><email>jg@w3.org</email></address>
402      </author>
403      <author initials="J." surname="Mogul" fullname="J. Mogul">
404        <organization>Compaq Computer Corporation</organization>
405        <address><email>mogul@wrl.dec.com</email></address>
406      </author>
407      <author initials="H." surname="Frystyk" fullname="H. Frystyk">
408        <organization>MIT Laboratory for Computer Science</organization>
409        <address><email>frystyk@w3.org</email></address>
410      </author>
411      <author initials="L." surname="Masinter" fullname="L. Masinter">
412        <organization>Xerox Corporation</organization>
413        <address><email>masinter@parc.xerox.com</email></address>
414      </author>
415      <author initials="P." surname="Leach" fullname="P. Leach">
416        <organization>Microsoft Corporation</organization>
417        <address><email>paulle@microsoft.com</email></address>
418      </author>
419      <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
420        <organization>W3C</organization>
421        <address><email>timbl@w3.org</email></address>
422      </author>
423      <date month="June" year="1999"/>
424    </front>
425    <seriesInfo name="RFC" value="2616"/>
426  </reference>
427
428  <reference anchor="RFC5987">
429        <front>
430      <title>Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters</title>
431      <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke">
432        <organization abbrev="greenbytes">greenbytes GmbH</organization>
433        <address>
434          <postal>
435            <street>Hafenweg 16</street>
436            <city>Muenster</city><region>NW</region><code>48155</code>
437            <country>Germany</country>
438          </postal>
439          <email>julian.reschke@greenbytes.de</email>   
440          <uri>http://greenbytes.de/tech/webdav/</uri> 
441        </address>
442      </author>
443      <date month="August" year="2010"/>
444    </front>
445    <seriesInfo name="RFC" value="5987"/>
446  </reference>
447
448  <reference anchor="ISO-8859-1">
449    <front>
450      <title>Information technology -- 8-bit single-byte coded graphic character sets -- Part 1: Latin alphabet No. 1</title>
451      <author>
452        <organization>International Organization for Standardization</organization>
453      </author>
454      <date year="1998"/>
455    </front>
456    <seriesInfo name="ISO/IEC" value="8859-1:1998"/>
457  </reference>
458
459</references>
460 
461<references title="Informative References">
462
463  <reference anchor="RFC2046">
464    <front>
465      <title abbrev="Media Types">Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types</title>
466      <author initials="N." surname="Freed" fullname="Ned Freed">
467        <organization>Innosoft International, Inc.</organization>
468        <address><email>ned@innosoft.com</email></address>
469      </author>
470      <author initials="N." surname="Borenstein" fullname="Nathaniel S. Borenstein">
471        <organization>First Virtual Holdings</organization>
472        <address><email>nsb@nsb.fv.com</email></address>
473      </author>
474      <date month="November" year="1996"/>
475    </front>
476    <seriesInfo name="RFC" value="2046"/>
477  </reference>
478
479  <reference anchor="RFC2047">
480    <front>
481      <title abbrev="Message Header Extensions">MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text</title>
482      <author initials="K." surname="Moore" fullname="Keith Moore">
483        <organization>University of Tennessee</organization>
484        <address><email>moore@cs.utk.edu</email></address>
485      </author>
486      <date month="November" year="1996"/>
487    </front>
488    <seriesInfo name="RFC" value="2047"/>
489  </reference>
490
491  <reference anchor="RFC2183">
492    <front>
493      <title abbrev="Content-Disposition">Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field</title>
494      <author initials="R." surname="Troost" fullname="Rens Troost">
495        <organization>New Century Systems</organization>
496        <address><email>rens@century.com</email></address>
497      </author>
498      <author initials="S." surname="Dorner" fullname="Steve Dorner">
499        <organization>QUALCOMM Incorporated</organization>
500        <address><email>sdorner@qualcomm.com</email></address>
501      </author>
502      <author initials="K." surname="Moore" fullname="Keith Moore">
503        <organization>Department of Computer Science</organization>
504        <address><email>moore@cs.utk.edu</email></address>
505      </author>
506      <date year="1997" month="August"/>
507    </front>
508    <seriesInfo name="RFC" value="2183"/>
509  </reference>
510
511  <reference anchor="RFC2231">
512    <front>
513      <title abbrev="MIME Value and Encoded Word Extensions">MIME Parameter Value and Encoded Word Extensions: Character Sets, Languages, and Continuations</title>
514      <author initials="N." surname="Freed" fullname="Ned Freed">
515        <organization abbrev="Innosoft">Innosoft International, Inc.</organization>
516        <address><email>ned.freed@innosoft.com</email></address>
517      </author>
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 year="1997" month="November"/>
523    </front>
524    <seriesInfo name="RFC" value="2231"/>
525  </reference>
526
527  <reference anchor="RFC3629">
528    <front>
529      <title>UTF-8, a transformation format of ISO 10646</title>
530      <author initials="F." surname="Yergeau" fullname="F. Yergeau">
531        <organization>Alis Technologies</organization>
532        <address><email>fyergeau@alis.com</email></address>
533      </author>
534      <date month="November" year="2003"/>
535    </front>
536    <seriesInfo name="STD" value="63"/>
537    <seriesInfo name="RFC" value="3629"/>
538  </reference>
539
540  <reference anchor="RFC3864">
541    <front>
542      <title>Registration Procedures for Message Header Fields</title>
543      <author initials="G." surname="Klyne" fullname="G. Klyne">
544        <organization>Nine by Nine</organization>
545        <address><email>GK-IETF@ninebynine.org</email></address>
546      </author>
547      <author initials="M." surname="Nottingham" fullname="M. Nottingham">
548        <organization>BEA Systems</organization>
549        <address><email>mnot@pobox.com</email></address>
550      </author>
551      <author initials="J." surname="Mogul" fullname="J. Mogul">
552        <organization>HP Labs</organization>
553        <address><email>JeffMogul@acm.org</email></address>
554      </author>
555      <date year="2004" month="September"/>
556    </front>
557    <seriesInfo name="BCP" value="90"/>
558    <seriesInfo name="RFC" value="3864"/>
559  </reference>
560
561  <reference anchor="RFC3986">
562   <front>
563    <title abbrev="URI Generic Syntax">Uniform Resource Identifier (URI): Generic Syntax</title>
564    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
565      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
566      <address>
567         <email>timbl@w3.org</email>
568         <uri>http://www.w3.org/People/Berners-Lee/</uri>
569      </address>
570    </author>
571    <author initials="R." surname="Fielding" fullname="Roy T. Fielding">
572      <organization abbrev="Day Software">Day Software</organization>
573      <address>
574        <email>fielding@gbiv.com</email>
575        <uri>http://roy.gbiv.com/</uri>
576      </address>
577    </author>
578    <author initials="L." surname="Masinter" fullname="Larry Masinter">
579      <organization abbrev="Adobe Systems">Adobe Systems Incorporated</organization>
580      <address>
581        <email>LMM@acm.org</email>
582        <uri>http://larry.masinter.net/</uri>
583      </address>
584    </author>
585    <date month="January" year="2005"/>
586   </front>
587   <seriesInfo name="STD" value="66"/>
588   <seriesInfo name="RFC" value="3986"/>
589  </reference>
590
591</references>
592
593<section title="Changes from the RFC 2616 Definition" anchor="changes.from.rfc2616">
594<t>
595  Compared to <xref target="RFC2616" x:fmt="of" x:sec="19.5.1"/>, the following
596  normative changes reflecting actual implementations have been made:
597<list style="symbols">
598  <t>
599    According to RFC 2616, the disposition type "attachment" only applies to
600    content of type "application/octet-stream". This restriction has been
601    removed, because user agents in practice do not check the content type, and
602    it also discourages properly declaring the media type.
603  </t>
604  <t>
605    RFC 2616 only allows "quoted-string" for the filename parameter. This
606    would be an exceptional parameter syntax, and also doesn't reflect actual
607    use.
608  </t>
609  <t>
610    The definition for the disposition type "inline" (<xref target="RFC2183" x:fmt="," x:sec="2.1"/>)
611    has been re-added with a suggestion for its processing.
612  </t>
613  <t>
614    This specification requires support for the extended parameter encoding
615    defined in <xref target="RFC5987"/>.
616  </t>
617</list>
618</t>
619</section>
620
621<section title="Differences compared to RFC 2183" anchor="diffs.compared.to.rfc2183">
622<t>
623  <xref target="RFC2183" x:fmt="of" x:sec="2"/> defines several additional
624  disposition parameters: "creation-date", "modification-date",
625  "quoted-date-time", and "size". These do not appear to be implemented by
626  any user agent, thus have been omitted from this specification.
627</t>
628</section>
629
630<section title="Alternative Approaches to Internationalization" anchor="alternatives">
631<t>
632  By default, HTTP header field parameters cannot carry characters outside
633  the ISO-8859-1 (<xref target="ISO-8859-1"/>) character encoding (see
634  <xref target="RFC2616" x:fmt="," x:sec="2.2"/>). For the "filename"
635  parameter, this of course is an unacceptable restriction.
636</t>
637<t>
638  Unfortunately, user agent implementers have not managed to come up with
639  an interoperable approach, although the IETF Standards Track specifies
640  exactly one solution (<xref target="RFC2231"/>, clarified and profiled for
641  HTTP in <xref target="RFC5987"/>).
642</t>
643<t>
644  For completeness, the sections below describe the various approaches that
645  have been tried, and explains how they are inferior to the RFC 5987
646  encoding used in this specification.
647</t>
648
649<section title="RFC 2047 Encoding" anchor="alternatives.rfc2047">
650<t>
651  RFC 2047 defines an encoding mechanism for
652  header fields, but this encoding is not supposed to be used for
653  header field parameters - see <xref target="RFC2047" x:fmt="of" x:sec="5"/>
654</t>
655<x:blockquote cite="http://tools.ietf.org/html/rfc2047#section-5">
656  <t>
657    An 'encoded-word' MUST NOT appear within a 'quoted-string'.
658  </t>
659  <t>
660    ...
661  </t>
662  <t>
663    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'.
664  </t>
665</x:blockquote>
666<t>
667  In practice, some user agents implement the encoding, some do not
668  (exposing the encoded string to the user), and some get confused by it.
669</t>
670</section>
671
672<section title="Percent Encoding" anchor="alternatives.percent">
673<t>
674  Some user agents accept percent encoded (<xref target="RFC3986" x:fmt="," x:sec="2.1"/>)
675  sequences of characters encoded using the UTF-8 (<xref target="RFC3629"/>) character encoding.
676</t>
677<t>
678  In practice, this is hard to use because those user agents
679  that do not support it will display the escaped character sequence to the user.
680</t>
681<t>
682  Furthermore, the first user agent to implement this did choose the encoding
683  based on local settings; thus making it very hard to use in multi-lingual
684  environments.
685</t>
686</section>
687
688<section title="Encoding Sniffing" anchor="alternatives.sniff">
689<t>
690  Some user agents inspect the value (which defaults to ISO-8859-1) and
691  switch to UTF-8 when it seems to be more likely to be the correct
692  interpretation.
693</t>
694<t>
695  As with the approaches above, this is not interoperable and furthermore
696  risks misinterpreting the actual value.
697</t>
698</section>
699
700<section title="Implementations (to be removed by RFC Editor before publication)" anchor="alternatives.implementations">
701<t>
702  Unfortunately, as of September 2010, neither the encoding defined in RFCs 2231
703  and 5987, nor any of the alternate approaches discussed above was
704  implemented interoperably. Thus, this specification recommends the approach
705  defined in RFC 5987, which at least has the advantage of actually being
706  specified properly.
707</t>
708<t>
709  The table below shows the implementation support for the various approaches:
710</t>
711<texttable align="left">
712  <ttcol>User Agent</ttcol>
713  <ttcol>RFC 2231/5987</ttcol>
714  <ttcol>RFC 2047</ttcol>
715  <ttcol>Percent Encoding</ttcol>
716  <ttcol>Encoding Sniffing</ttcol>
717 
718  <c>Chrome</c>
719  <c>no</c>
720  <c>yes</c>
721  <c>yes</c>
722  <c>yes</c>
723
724  <c>Firefox</c>
725  <c>yes (*)</c>
726  <c>yes</c>
727  <c>no</c>
728  <c>yes</c>
729
730  <c>Internet Explorer</c>
731  <c>no</c>
732  <c>no</c>
733  <c>yes</c>
734  <c>no</c>
735
736  <c>Konqueror</c>
737  <c>yes</c>
738  <c>no</c>
739  <c>no</c>
740  <c>no</c>
741
742  <c>Opera</c>
743  <c>yes (*)</c>
744  <c>no</c>
745  <c>no</c>
746  <c>no</c>
747
748  <c>Safari</c>
749  <c>no</c>
750  <c>no</c>
751  <c>no</c>
752  <c>yes</c>
753 
754  <postamble>
755  (*) Does not implement the fallback behavior to "filename" described in
756  <xref target="disposition.parameter.filename"/>.
757  </postamble>
758
759</texttable>
760
761</section>
762
763</section>
764
765
766<section title="Change Log (to be removed by RFC Editor before publication)" anchor="change.log">
767<t>
768  Note: the issues names in the change log entries for draft-reschke-rfc2183-in-http
769  refer to <eref target="http://greenbytes.de/tech/webdav/draft-reschke-rfc2183-in-http-issues.html"/>.
770</t>
771
772<section title="Since draft-reschke-rfc2183-in-http-00">
773<t> 
774  Adjust terminology ("header" -&gt; "header field").
775  Update rfc2231-in-http reference.
776</t>
777</section>
778
779<section title="Since draft-reschke-rfc2183-in-http-01">
780<t> 
781  Update rfc2231-in-http reference. Actually define the "filename"
782  parameter. Add internationalization considerations.
783  Add examples using the RFC 5987 encoding.
784  Add overview over other approaches, plus a table reporting
785  implementation status.
786  Add and resolve issue "nodep2183".
787  Add issues "asciivsiso",
788  "deplboth", "quoted", and "registry".
789</t>
790</section>
791
792<section title="Since draft-reschke-rfc2183-in-http-02">
793<t>
794  Add and close issue "docfallback".
795  Close issues "asciivsiso", "deplboth", "quoted", and
796  "registry".
797</t>
798</section>
799
800<section title="Since draft-reschke-rfc2183-in-http-03">
801<t>
802  Updated to be a Working Draft of the IETF HTTPbis Working Group.
803</t>
804</section>
805
806<section title="Since draft-ietf-httpbis-content-disp-00" anchor="changes.since.00">
807<t>
808  Closed issues:
809  <list style="symbols">
810    <t>
811      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/242"/>:
812      "handling of unknown disposition types"
813    </t>
814  </list>
815</t>
816<t>
817  Slightly updated the notes about the proposed fallback behavior.
818</t>
819</section>
820
821<section title="Since draft-ietf-httpbis-content-disp-01" anchor="changes.since.01">
822<t>
823  Various editorial improvements.
824</t>
825</section>
826
827<section title="Since draft-ietf-httpbis-content-disp-02" anchor="changes.since.02">
828<t>
829  Closed issues:
830  <list style="symbols">
831    <t>
832      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/246"/>:
833      "mention control chars when talking about postprecessing the filename parameter"
834    </t>
835  </list>
836</t>
837</section>
838</section>
839
840
841  </back>
842
843</rfc>
Note: See TracBrowser for help on using the repository browser.