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

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

prepare publication of draft-ietf-httpbis-content-disp on 2011-03-15

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