source: draft-ietf-httpbis-content-disp/08/draft-ietf-httpbis-content-disp.txt @ 2115

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

prepare -08

  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 33.5 KB
Line 
1
2
3
4HTTPbis Working Group                                         J. Reschke
5Internet-Draft                                                greenbytes
6Updates: 2616 (if approved)                               March 14, 2011
7Intended status: Standards Track
8Expires: September 15, 2011
9
10
11           Use of the Content-Disposition Header Field in the
12                   Hypertext Transfer Protocol (HTTP)
13                   draft-ietf-httpbis-content-disp-08
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.12.
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 15, 2011               [Page 1]
56
57Internet-Draft         Content-Disposition in HTTP            March 2011
58
59
60   This Internet-Draft will expire on September 15, 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 15, 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  . . . . . . . . 10
138   Appendix B.  Differences compared to RFC 2183  . . . . . . . . . . 11
139   Appendix C.  Alternative Approaches to Internationalization  . . . 11
140     C.1.  RFC 2047 Encoding  . . . . . . . . . . . . . . . . . . . . 11
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 . . . . . . . . . . 14
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   Index  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
162
163
164
165
166
167Reschke                Expires September 15, 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 notation defined in Section
200   2.1 of [RFC2616], including its rules for implied linear whitespace
201   (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 15, 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   Header field values with multiple instances of the same parameter
271   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 15, 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; this is of limited use for filenames and is
286   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 15, 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 SHOULD ensure
357      that a file extension is used that is safe, optimally matching the
358      media type of the received payload.
359
360   o  Recipients SHOULD strip or replace character sequences that are
361      known to cause confusion both in user interfaces and in filenames,
362      such as control characters and leading and trailing whitespace.
363
364   o  Other aspects recipients need to be aware of are names that have a
365      special meaning in the file system or in shell commands, such as
366      "." and "..", "~", "|", and also device names.  Recipients SHOULD
367      ignore or substitute names like these.
368
369      Note: Many user agents do not properly handle the escape character
370      "\" when using the quoted-string form.  Furthermore, some user
371      agents erroneously try to perform unescaping of "percent" escapes
372      (see Appendix C.2), and thus might misinterpret filenames
373      containing the percent character followed by two hex digits.
374
3754.4.  Disposition Parameter: Extensions
376
377   To enable future extensions, recipients SHOULD ignore unrecognized
378   parameters (see also [RFC2183], Section 2.8).
379
3804.5.  Extensibility
381
382   Note that Section 9 of [RFC2183] defines IANA registries both for
383   disposition types and disposition parameters.  This registry is
384   shared by different protocols using Content-Disposition, such as MIME
385   and HTTP.  Therefore, not all registered values may make sense in the
386   context of HTTP.
387
388
389
390
391Reschke                Expires September 15, 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 15, 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
4859.  Acknowledgements
486
487   Thanks to Adam Barth, Rolf Eike Beer, Stewart Bryant, Bjoern
488   Hoehrmann, Alfred Hoenes, Roar Lauritzsen, Alexey Melnikov, Henrik
489   Nordstrom, and Mark Nottingham for their valuable feedback.
490
49110.  References
492
49310.1.  Normative References
494
495   [ISO-8859-1]  International Organization for Standardization,
496                 "Information technology -- 8-bit single-byte coded
497                 graphic character sets -- Part 1: Latin alphabet No.
498                 1", ISO/IEC 8859-1:1998, 1998.
499
500
501
502
503Reschke                Expires September 15, 2011               [Page 9]
504
505Internet-Draft         Content-Disposition in HTTP            March 2011
506
507
508   [RFC2119]     Bradner, S., "Key words for use in RFCs to Indicate
509                 Requirement Levels", BCP 14, RFC 2119, March 1997.
510
511   [RFC2616]     Fielding, R., Gettys, J., Mogul, J., Frystyk, H.,
512                 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext
513                 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.
514
515   [RFC5987]     Reschke, J., "Character Set and Language Encoding for
516                 Hypertext Transfer Protocol (HTTP) Header Field
517                 Parameters", RFC 5987, August 2010.
518
51910.2.  Informative References
520
521   [RFC2046]     Freed, N. and N. Borenstein, "Multipurpose Internet
522                 Mail Extensions (MIME) Part Two: Media Types",
523                 RFC 2046, November 1996.
524
525   [RFC2047]     Moore, K., "MIME (Multipurpose Internet Mail
526                 Extensions) Part Three: Message Header Extensions for
527                 Non-ASCII Text", RFC 2047, November 1996.
528
529   [RFC2183]     Troost, R., Dorner, S., and K. Moore, "Communicating
530                 Presentation Information in Internet Messages: The
531                 Content-Disposition Header Field", RFC 2183,
532                 August 1997.
533
534   [RFC2231]     Freed, N. and K. Moore, "MIME Parameter Value and
535                 Encoded Word Extensions: Character Sets, Languages, and
536                 Continuations", RFC 2231, November 1997.
537
538   [RFC2388]     Masinter, L., "Returning Values from Forms: multipart/
539                 form-data", RFC 2388, August 1998.
540
541   [RFC3864]     Klyne, G., Nottingham, M., and J. Mogul, "Registration
542                 Procedures for Message Header Fields", BCP 90,
543                 RFC 3864, September 2004.
544
545   [RFC3986]     Berners-Lee, T., Fielding, R., and L. Masinter,
546                 "Uniform Resource Identifier (URI): Generic Syntax",
547                 STD 66, RFC 3986, January 2005.
548
549Appendix A.  Changes from the RFC 2616 Definition
550
551   Compared to Section 19.5.1 of [RFC2616], the following normative
552   changes reflecting actual implementations have been made:
553
554   o  According to RFC 2616, the disposition type "attachment" only
555      applies to content of type "application/octet-stream".  This
556
557
558
559Reschke                Expires September 15, 2011              [Page 10]
560
561Internet-Draft         Content-Disposition in HTTP            March 2011
562
563
564      restriction has been removed, because recipients in practice do
565      not check the content type, and it also discourages properly
566      declaring the media type.
567
568   o  RFC 2616 only allows "quoted-string" for the filename parameter.
569      This would be an exceptional parameter syntax, and also doesn't
570      reflect actual use.
571
572   o  The definition for the disposition type "inline" ([RFC2183],
573      Section 2.1) has been re-added with a suggestion for its
574      processing.
575
576   o  This specification requires support for the extended parameter
577      encoding defined in [RFC5987].
578
579Appendix B.  Differences compared to RFC 2183
580
581   Section 2 of [RFC2183] defines several additional disposition
582   parameters: "creation-date", "modification-date", "quoted-date-time",
583   and "size".  The majority of user agents does not implement these,
584   thus they have been omitted from this specification.
585
586Appendix C.  Alternative Approaches to Internationalization
587
588   By default, HTTP header field parameters cannot carry characters
589   outside the ISO-8859-1 ([ISO-8859-1]) character encoding (see
590   [RFC2616], Section 2.2).  For the "filename" parameter, this of
591   course is an unacceptable restriction.
592
593   Unfortunately, user agent implementers have not managed to come up
594   with an interoperable approach, although the IETF Standards Track
595   specifies exactly one solution ([RFC2231], clarified and profiled for
596   HTTP in [RFC5987]).
597
598   For completeness, the sections below describe the various approaches
599   that have been tried, and explains how they are inferior to the RFC
600   5987 encoding used in this specification.
601
602C.1.  RFC 2047 Encoding
603
604   RFC 2047 defines an encoding mechanism for header fields, but this
605   encoding is not supposed to be used for header field parameters - see
606   Section 5 of [RFC2047]:
607
608      An 'encoded-word' MUST NOT appear within a 'quoted-string'.
609
610      ...
611
612
613
614
615Reschke                Expires September 15, 2011              [Page 11]
616
617Internet-Draft         Content-Disposition in HTTP            March 2011
618
619
620      An 'encoded-word' MUST NOT be used in parameter of a MIME Content-
621      Type or Content-Disposition field, or in any structured field body
622      except within a 'comment' or 'phrase'.
623
624   In practice, some user agents implement the encoding, some do not
625   (exposing the encoded string to the user), and some get confused by
626   it.
627
628C.2.  Percent Encoding
629
630   Some user agents accept percent encoded ([RFC3986], Section 2.1)
631   sequences of characters.  The character encoding being used for
632   decoding depends on various factors, including the encoding of the
633   referring page, the user agent's locale, its configuration, and also
634   the actual value of the parameter.
635
636   In practice, this is hard to use because those user agents that do
637   not support it will display the escaped character sequence to the
638   user.  For those user agents that do implement this it is difficult
639   to predict what character encoding they actually expect.
640
641C.3.  Encoding Sniffing
642
643   Some user agents inspect the value (which defaults to ISO-8859-1 for
644   the quoted-string form) and switch to UTF-8 when it seems to be more
645   likely to be the correct interpretation.
646
647   As with the approaches above, this is not interoperable and
648   furthermore risks misinterpreting the actual value.
649
650C.4.  Implementations (to be removed by RFC Editor before publication)
651
652   Unfortunately, as of March 2011, neither the encoding defined in RFCs
653   2231 and 5987, nor any of the alternate approaches discussed above
654   was implemented interoperably.  Thus, this specification recommends
655   the approach defined in RFC 5987, which at least has the advantage of
656   actually being specified properly.
657
658   The table below shows the implementation support for the various
659   approaches:
660
661
662
663
664
665
666
667
668
669
670
671Reschke                Expires September 15, 2011              [Page 12]
672
673Internet-Draft         Content-Disposition in HTTP            March 2011
674
675
676   +---------------+------------+--------+--------------+--------------+
677   | User Agent    | RFC        | RFC    | Percent      | Encoding     |
678   |               | 2231/5987  | 2047   | Encoding     | Sniffing     |
679   +---------------+------------+--------+--------------+--------------+
680   | Chrome        | yes        | yes    | yes          | yes          |
681   | Firefox       | yes (*)    | yes    | no           | yes          |
682   | Internet      | yes (**)   | no     | yes          | no           |
683   | Explorer      |            |        |              |              |
684   | Konqueror     | yes        | no     | no           | no           |
685   | Opera         | yes        | no     | no           | no           |
686   | Safari        | no         | no     | no           | yes          |
687   +---------------+------------+--------+--------------+--------------+
688
689   (*) Does not implement the fallback behavior to "filename" described
690   in Section 4.3; a fix is planned for Firefox 5.
691
692   (**) Starting with IE9RC, but only implements UTF-8.
693
694Appendix D.  Advice on Generating Content-Disposition Header Fields
695
696   To successfully interoperate with existing and future user agents,
697   senders of the Content-Disposition header field are advised to:
698
699   o  Include a "filename" parameter when US-ASCII is sufficiently
700      expressive.
701
702   o  Use the 'token' form of the filename parameter only when it does
703      not contain disallowed characters (e.g., spaces); in such cases,
704      the quoted-string form should be used.
705
706   o  Avoid including the percent character followed by two hexadecimal
707      characters (e.g., %A9) in the filename parameter, since some
708      existing implementations consider it to be an escape character,
709      while others will pass it through unchanged.
710
711   o  Avoid including the "\" character in the quoted-string form of the
712      filename parameter, as escaping is not implemented by some user
713      agents, and can be considered as an illegal path character.
714
715   o  Avoid using non-ASCII characters in the filename parameter.
716      Although most existing implementations will decode them as ISO-
717      8859-1, some will apply heuristics to detect UTF-8, and thus might
718      fail on certain names.
719
720   o  Include a "filename*" parameter where the desired filename cannot
721      be expressed faithfully using the "filename" form.  Note that
722      legacy user agents will not process this, and will fall back to
723      using the "filename" parameter's content.
724
725
726
727Reschke                Expires September 15, 2011              [Page 13]
728
729Internet-Draft         Content-Disposition in HTTP            March 2011
730
731
732   o  When a "filename*" parameter is sent, to also generate a
733      "filename" parameter as a fallback for user agents that do not
734      support the "filename*" form, if possible.  This can be done by
735      substituting characters with US-ASCII sequences (e.g., Unicode
736      character point U+00E4 (LATIN SMALL LETTER A WITH DIARESIS) by
737      "ae").  Note that this may not be possible in some locales.
738
739   o  When a "filename" parameter is included as a fallback (as per
740      above), "filename" should occur first, due to parsing problems in
741      some existing implementations. [[fallbackbug: Firefox is known to
742      pick the wrong parameter; a bug fix is scheduled for Firefox 5.
743      --jre]]
744
745   o  Use UTF-8 as the encoding of the "filename*" parameter, when
746      present, because at least one existing implementation only
747      implements that encoding.
748
749   Note that this advice is based upon UA behaviour at the time of
750   writing, and might be superseded.  At the time of publication of this
751   document, <http://purl.org/NET/http/content-disposition-tests>
752   provides an overview of current levels of support in various
753   implementations.
754
755Appendix E.  Change Log (to be removed by RFC Editor before publication)
756
757   Note: the issues names in the change log entries for
758   draft-reschke-rfc2183-in-http refer to <http://greenbytes.de/tech/
759   webdav/draft-reschke-rfc2183-in-http-issues.html>.
760
761E.1.  Since draft-reschke-rfc2183-in-http-00
762
763   Adjust terminology ("header" -> "header field").  Update rfc2231-in-
764   http reference.
765
766E.2.  Since draft-reschke-rfc2183-in-http-01
767
768   Update rfc2231-in-http reference.  Actually define the "filename"
769   parameter.  Add internationalization considerations.  Add examples
770   using the RFC 5987 encoding.  Add overview over other approaches,
771   plus a table reporting implementation status.  Add and resolve issue
772   "nodep2183".  Add issues "asciivsiso", "deplboth", "quoted", and
773   "registry".
774
775E.3.  Since draft-reschke-rfc2183-in-http-02
776
777   Add and close issue "docfallback".  Close issues "asciivsiso",
778   "deplboth", "quoted", and "registry".
779
780
781
782
783Reschke                Expires September 15, 2011              [Page 14]
784
785Internet-Draft         Content-Disposition in HTTP            March 2011
786
787
788E.4.  Since draft-reschke-rfc2183-in-http-03
789
790   Updated to be a Working Draft of the IETF HTTPbis Working Group.
791
792E.5.  Since draft-ietf-httpbis-content-disp-00
793
794   Closed issues:
795
796   o  <http://tools.ietf.org/wg/httpbis/trac/ticket/242>: "handling of
797      unknown disposition types"
798
799   Slightly updated the notes about the proposed fallback behavior.
800
801E.6.  Since draft-ietf-httpbis-content-disp-01
802
803   Various editorial improvements.
804
805E.7.  Since draft-ietf-httpbis-content-disp-02
806
807   Closed issues:
808
809   o  <http://tools.ietf.org/wg/httpbis/trac/ticket/244>: "state that
810      repeating parameters are invalid"
811
812   o  <http://tools.ietf.org/wg/httpbis/trac/ticket/245>: "warn about
813      %xx in filenames being misinterpreted"
814
815   o  <http://tools.ietf.org/wg/httpbis/trac/ticket/246>: "mention
816      control chars when talking about postprecessing the filename
817      parameter"
818
819   Update Appendix C.4; Opera 10.63 RC implements the recommended
820   fallback behavior.
821
822E.8.  Since draft-ietf-httpbis-content-disp-03
823
824   Closed issues:
825
826   o  <http://tools.ietf.org/wg/httpbis/trac/ticket/252>:
827      "'modification-date' *is* implemented in Konq 4.5"
828
829   o  <http://tools.ietf.org/wg/httpbis/trac/ticket/253>: "clarify what
830      LWS means for the Content-Disp grammar"
831
832   o  <http://tools.ietf.org/wg/httpbis/trac/ticket/258>: "Avoid passive
833      voice in message requirements"
834
835
836
837
838
839Reschke                Expires September 15, 2011              [Page 15]
840
841Internet-Draft         Content-Disposition in HTTP            March 2011
842
843
844   o  <http://tools.ietf.org/wg/httpbis/trac/ticket/263>: "text about
845      historical percent-decoding unclear"
846
847   o  <http://tools.ietf.org/wg/httpbis/trac/ticket/264>: "add
848      explanation of language tagging"
849
850   o  <http://tools.ietf.org/wg/httpbis/trac/ticket/265>: "Clarify that
851      C-D spec does not apply to multipart upload"
852
853E.9.  Since draft-ietf-httpbis-content-disp-04
854
855   Updated implementation information (Chrome 9 implements RFC 5987, IE
856   9 RC implements it for UTF-8 only).
857
858   Clarify who requirements are on, add a section discussing conformance
859   and handling of invalid field values in general.
860
861   Closed issues:
862
863   o  <http://trac.tools.ietf.org/wg/httpbis/trac/ticket/243>: "avoid
864      stating ISO-8859-1 default for header param" (the default is still
865      mentioned, but it was clarified what it applies to).
866
867   o  <http://tools.ietf.org/wg/httpbis/trac/ticket/272>: "Path
868      Separator Characters"
869
870E.10.  Since draft-ietf-httpbis-content-disp-05
871
872   Editorial changes: Fixed two typos where the new Conformance section
873   said "Content-Location" instead of "Content-Disposition".  Cleaned up
874   terminology ("user agent", "recipient", "sender", "message body",
875   ...).  Stated what the escape character for quoted-string is.
876   Explained a use case for "inline" disposition type.  Updated
877   implementation notes with respect to the fallback behavior.
878
879   Added appendix "Advice on Generating Content-Disposition Header
880   Fields".
881
882E.11.  Since draft-ietf-httpbis-content-disp-06
883
884   Closed issues:
885
886   o  <http://trac.tools.ietf.org/wg/httpbis/trac/ticket/278>:
887      "conformance language"
888
889
890
891
892
893
894
895Reschke                Expires September 15, 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
907Index
908
909   C
910      Content-Disposition header field  5
911
912   H
913      Header Fields
914         Content-Disposition  5
915
916Author's Address
917
918   Julian F. Reschke
919   greenbytes GmbH
920   Hafenweg 16
921   Muenster, NW  48155
922   Germany
923
924   EMail: julian.reschke@greenbytes.de
925   URI:   http://greenbytes.de/tech/webdav/
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951Reschke                Expires September 15, 2011              [Page 17]
952
Note: See TracBrowser for help on using the repository browser.