source: draft-ietf-httpbis-content-disp/09/draft-ietf-httpbis-content-disp.txt @ 1211

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

Prepare publication of C-D -08 on March 28.

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