source: draft-ietf-httpbis-content-disp/latest/draft-ietf-httpbis-content-disp.html

Last change on this file was 2726, checked in by julian.reschke@…, 6 years ago

update to latest version of rfc2629.xslt, regen all HTML

  • Property svn:eol-style set to native
File size: 52.7 KB
RevLine 
[982]1<!DOCTYPE html
2  PUBLIC "-//W3C//DTD HTML 4.01//EN">
3<html lang="en">
[2726]4   <head profile="http://dublincore.org/documents/2008/08/04/dc-html/">
[982]5      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6      <title>Use of the Content-Disposition&nbsp;Header&nbsp;Field
7         in the Hypertext&nbsp;Transfer&nbsp;Protocol&nbsp;(HTTP)
8      </title><style type="text/css" title="Xml2Rfc (sans serif)">
9a {
10  text-decoration: none;
11}
12a.smpl {
13  color: black;
14}
15a:hover {
16  text-decoration: underline;
17}
18a:active {
19  text-decoration: underline;
20}
21address {
22  margin-top: 1em;
23  margin-left: 2em;
24  font-style: normal;
25}
26blockquote {
27  border-style: solid;
28  border-color: gray;
29  border-width: 0 0 0 .25em;
30  font-style: italic;
31  padding-left: 0.5em;
32}
33body {
34  color: black;
[2726]35  font-family: cambria, helvetica, arial, sans-serif;
36  font-size: 11pt;
37  margin-right: 2em;
[982]38}
39cite {
40  font-style: normal;
41}
[1041]42div.note {
43  margin-left: 2em;
44}
[982]45dl {
46  margin-left: 2em;
47}
48ul.empty {
49  list-style-type: none;
50}
51ul.empty li {
52  margin-top: .5em;
53}
54dl p {
55  margin-left: 0em;
56}
57dt {
58  margin-top: .5em;
59}
60h1 {
[2726]61  font-size: 130%;
[982]62  line-height: 21pt;
63  page-break-after: avoid;
64}
65h1.np {
66  page-break-before: always;
67}
68h2 {
[2726]69  font-size: 120%;
[982]70  line-height: 15pt;
71  page-break-after: avoid;
72}
[2726]73h3 {
74  font-size: 110%;
[982]75  page-break-after: avoid;
76}
[2726]77h4, h5, h6 {
78  page-break-after: avoid;
79}
80h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
[982]81  color: black;
82}
83img {
84  margin-left: 3em;
85}
86li {
87  margin-left: 2em;
88}
89ol {
90  margin-left: 2em;
91}
[1145]92ol.la {
93  list-style-type: lower-alpha;
94}
95ol.ua {
96  list-style-type: upper-alpha;
97}
[982]98ol p {
99  margin-left: 0em;
100}
101p {
102  margin-left: 2em;
103}
104pre {
105  margin-left: 3em;
106  background-color: lightyellow;
107  padding: .25em;
[2726]108  page-break-inside: avoid;
[982]109}
110pre.text2 {
111  border-style: dotted;
112  border-width: 1px;
113  background-color: #f0f0f0;
114  width: 69em;
115}
116pre.inline {
117  background-color: white;
118  padding: 0em;
119}
120pre.text {
121  border-style: dotted;
122  border-width: 1px;
123  background-color: #f8f8f8;
124  width: 69em;
125}
126pre.drawing {
127  border-style: solid;
128  border-width: 1px;
129  background-color: #f8f8f8;
130  padding: 2em;
131}
132table {
133  margin-left: 2em;
134}
135table.header {
136  border-spacing: 1px;
137  width: 95%;
[2726]138  font-size: 11pt;
[982]139  color: white;
140}
141td.top {
142  vertical-align: top;
143}
144td.topnowrap {
145  vertical-align: top;
[2726]146  white-space: nowrap;
[982]147}
148table.header td {
149  background-color: gray;
150  width: 50%;
151}
152table.header a {
153  color: white;
154}
155td.reference {
156  vertical-align: top;
157  white-space: nowrap;
158  padding-right: 1em;
159}
160thead {
161  display:table-header-group;
162}
[1072]163ul.toc, ul.toc ul {
[982]164  list-style: none;
165  margin-left: 1.5em;
166  padding-left: 0em;
167}
[1072]168ul.toc li {
[982]169  line-height: 150%;
170  font-weight: bold;
171  margin-left: 0em;
172}
[1072]173ul.toc li li {
[982]174  line-height: normal;
175  font-weight: normal;
[2726]176  font-size: 10pt;
[982]177  margin-left: 0em;
178}
[1072]179li.excluded {
[982]180  font-size: 0pt;
181}
182ul p {
183  margin-left: 0em;
184}
[2726]185.title, .filename, h1, h2, h3, h4 {
186  font-family: candara, helvetica, arial, sans-serif;
187}
188samp, tt, code, pre {
189  font: consolas, monospace;
190}
[982]191.bcp14 {
192  font-style: normal;
193  text-transform: lowercase;
194  font-variant: small-caps;
195}
196blockquote > * .bcp14 {
197  font-style: italic;
198}
199.comment {
200  background-color: yellow;
201}
202.center {
203  text-align: center;
204}
205.error {
206  color: red;
207  font-style: italic;
208  font-weight: bold;
209}
210.figure {
211  font-weight: bold;
212  text-align: center;
[2726]213  font-size: 10pt;
[982]214}
215.filename {
216  color: #333333;
[2726]217  font-size: 75%;
[982]218  font-weight: bold;
219  line-height: 21pt;
220  text-align: center;
221}
222.fn {
223  font-weight: bold;
224}
225.left {
226  text-align: left;
227}
228.right {
229  text-align: right;
230}
231.title {
[2726]232  color: green;
233  font-size: 150%;
[982]234  line-height: 18pt;
235  font-weight: bold;
236  text-align: center;
237  margin-top: 36pt;
238}
239.warning {
[2726]240  font-size: 130%;
[982]241  background-color: yellow;
242}
243
244
245@media print {
246  .noprint {
247    display: none;
248  }
[2726]249
[982]250  a {
251    color: black;
252    text-decoration: none;
253  }
254
255  table.header {
256    width: 90%;
257  }
258
259  td.header {
260    width: 50%;
261    color: black;
262    background-color: white;
263    vertical-align: top;
[2726]264    font-size: 110%;
[982]265  }
266
[2726]267  ul.toc a:nth-child(2)::after {
[982]268    content: leader('.') target-counter(attr(href), page);
269  }
[2726]270
[1072]271  ul.ind li li a {
[982]272    content: target-counter(attr(href), page);
273  }
[2726]274
[982]275  .print2col {
276    column-count: 2;
277    -moz-column-count: 2;
278    column-fill: auto;
279  }
280}
281
282@page {
283  @top-left {
[2726]284       content: "Internet-Draft";
285  }
[982]286  @top-right {
[2726]287       content: "June 2011";
288  }
[982]289  @top-center {
[2726]290       content: "Content-Disposition in HTTP";
291  }
[982]292  @bottom-left {
[2726]293       content: "Reschke";
294  }
[982]295  @bottom-center {
[2726]296       content: "Expires December 2011";
297  }
[982]298  @bottom-right {
[2726]299       content: "[Page " counter(page) "]";
300  }
[982]301}
302
[2726]303@page:first {
[982]304    @top-left {
305      content: normal;
306    }
307    @top-right {
308      content: normal;
309    }
310    @top-center {
311      content: normal;
312    }
313}
314</style><link rel="Contents" href="#rfc.toc">
315      <link rel="Author" href="#rfc.authors">
316      <link rel="Copyright" href="#rfc.copyrightnotice">
317      <link rel="Chapter" title="1 Introduction" href="#rfc.section.1">
318      <link rel="Chapter" title="2 Notational Conventions" href="#rfc.section.2">
[1115]319      <link rel="Chapter" title="3 Conformance and Error Handling" href="#rfc.section.3">
320      <link rel="Chapter" title="4 Header Field Definition" href="#rfc.section.4">
321      <link rel="Chapter" title="5 Examples" href="#rfc.section.5">
322      <link rel="Chapter" title="6 Internationalization Considerations" href="#rfc.section.6">
323      <link rel="Chapter" title="7 Security Considerations" href="#rfc.section.7">
324      <link rel="Chapter" title="8 IANA Considerations" href="#rfc.section.8">
325      <link rel="Chapter" title="9 Acknowledgements" href="#rfc.section.9">
326      <link rel="Chapter" href="#rfc.section.10" title="10 References">
[982]327      <link rel="Appendix" title="A Changes from the RFC 2616 Definition" href="#rfc.section.A">
[1293]328      <link rel="Appendix" title="B Differences Compared to RFC 2183" href="#rfc.section.B">
[982]329      <link rel="Appendix" title="C Alternative Approaches to Internationalization" href="#rfc.section.C">
[1142]330      <link rel="Appendix" title="D Advice on Generating Content-Disposition Header Fields" href="#rfc.section.D">
[1305]331      <link rel="Alternate" title="RFC6266" href="http://greenbytes.de/tech/webdav/rfc6266.html">
[2726]332      <meta name="generator" content="http://greenbytes.de/tech/webdav/rfc2629.xslt, Revision 1.640, 2014/06/13 12:42:58, XSLT vendor: SAXON 8.9 from Saxonica http://www.saxonica.com/">
[1295]333      <meta name="keywords" content="HTTP, Hypertext Transfer Protocol, Content-Disposition, filename, attachment, inline">
[982]334      <link rel="schema.dct" href="http://purl.org/dc/terms/">
335      <meta name="dct.creator" content="Reschke, J. F.">
336      <meta name="dct.identifier" content="urn:ietf:id:draft-ietf-httpbis-content-disp-latest">
[2726]337      <meta name="dct.issued" scheme="ISO8601" content="2011-06">
[1131]338      <meta name="dct.abstract" content="RFC 2616 defines the Content-Disposition response header field, but points out that it is not part of the HTTP/1.1 Standard. This specification takes over the definition and registration of Content-Disposition, as used in HTTP, and clarifies internationalization aspects.">
339      <meta name="description" content="RFC 2616 defines the Content-Disposition response header field, but points out that it is not part of the HTTP/1.1 Standard. This specification takes over the definition and registration of Content-Disposition, as used in HTTP, and clarifies internationalization aspects.">
[982]340   </head>
341   <body>
342      <table class="header">
343         <tbody>
344            <tr>
345               <td class="left">HTTPbis Working Group</td>
346               <td class="right">J. Reschke</td>
347            </tr>
348            <tr>
349               <td class="left">Internet-Draft</td>
350               <td class="right">greenbytes</td>
351            </tr>
352            <tr>
[2726]353               <td class="left">Updates: <a href="https://tools.ietf.org/html/rfc2616">2616</a> (if approved)
[982]354               </td>
[2726]355               <td class="right">June 2011</td>
[982]356            </tr>
357            <tr>
358               <td class="left">Intended status: Standards Track</td>
359               <td class="right"></td>
360            </tr>
361            <tr>
[2726]362               <td class="left">Expires: December 2011</td>
[982]363               <td class="right"></td>
364            </tr>
365         </tbody>
366      </table>
367      <p class="title">Use of the Content-Disposition&nbsp;Header&nbsp;Field in the Hypertext&nbsp;Transfer&nbsp;Protocol&nbsp;(HTTP)<br><span class="filename">draft-ietf-httpbis-content-disp-latest</span></p>
[1305]368      <p style="color: green; text-align: center; font-size: 14pt; background-color: yellow;"><b>Note:</b> a later version of this document has been published as <a href="http://greenbytes.de/tech/webdav/rfc6266.html">RFC6266</a>.
369         
370      </p>
[2726]371      <h1 id="rfc.abstract"><a href="#rfc.abstract">Abstract</a></h1>
[1131]372      <p>RFC 2616 defines the Content-Disposition response header field, but points out that it is not part of the HTTP/1.1 Standard.
[982]373         This specification takes over the definition and registration of Content-Disposition, as used in HTTP, and clarifies internationalization
374         aspects.
375      </p>
[2726]376      <div id="rfc.status">
377         <h1><a href="#rfc.status">Status of This Memo</a></h1>
378         <p>This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.</p>
379         <p>Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute
380            working documents as Internet-Drafts. The list of current Internet-Drafts is at <a href="http://datatracker.ietf.org/drafts/current/">http://datatracker.ietf.org/drafts/current/</a>.
381         </p>
382         <p>Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other
383            documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as “work
384            in progress”.
385         </p>
386         <p>This Internet-Draft will expire in December 2011.</p>
387      </div>
388      <div id="rfc.copyrightnotice">
389         <h1><a href="#rfc.copyrightnotice">Copyright Notice</a></h1>
390         <p>Copyright © 2011 IETF Trust and the persons identified as the document authors. All rights reserved.</p>
391         <p>This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (<a href="http://trustee.ietf.org/license-info">http://trustee.ietf.org/license-info</a>) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights
392            and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License
393            text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified
394            BSD License.
395         </p>
396      </div>
[982]397      <hr class="noprint">
398      <h1 class="np" id="rfc.toc"><a href="#rfc.toc">Table of Contents</a></h1>
399      <ul class="toc">
[2726]400         <li><a href="#rfc.section.1">1.</a>&nbsp;&nbsp;&nbsp;<a href="#introduction">Introduction</a></li>
401         <li><a href="#rfc.section.2">2.</a>&nbsp;&nbsp;&nbsp;<a href="#notational.conventions">Notational Conventions</a></li>
402         <li><a href="#rfc.section.3">3.</a>&nbsp;&nbsp;&nbsp;<a href="#conformance.and.error.handling">Conformance and Error Handling</a></li>
403         <li><a href="#rfc.section.4">4.</a>&nbsp;&nbsp;&nbsp;<a href="#header.field.definition">Header Field Definition</a><ul>
404               <li><a href="#rfc.section.4.1">4.1</a>&nbsp;&nbsp;&nbsp;<a href="#rfc.section.4.1">Grammar</a></li>
405               <li><a href="#rfc.section.4.2">4.2</a>&nbsp;&nbsp;&nbsp;<a href="#disposition.type">Disposition Type</a></li>
406               <li><a href="#rfc.section.4.3">4.3</a>&nbsp;&nbsp;&nbsp;<a href="#disposition.parameter.filename">Disposition Parameter: 'Filename'</a></li>
407               <li><a href="#rfc.section.4.4">4.4</a>&nbsp;&nbsp;&nbsp;<a href="#disposition.parameter.extensions">Disposition Parameter: Extensions</a></li>
408               <li><a href="#rfc.section.4.5">4.5</a>&nbsp;&nbsp;&nbsp;<a href="#extensibility">Extensibility</a></li>
[982]409            </ul>
410         </li>
[2726]411         <li><a href="#rfc.section.5">5.</a>&nbsp;&nbsp;&nbsp;<a href="#examples">Examples</a></li>
412         <li><a href="#rfc.section.6">6.</a>&nbsp;&nbsp;&nbsp;<a href="#i18n">Internationalization Considerations</a></li>
413         <li><a href="#rfc.section.7">7.</a>&nbsp;&nbsp;&nbsp;<a href="#security.considerations">Security Considerations</a></li>
414         <li><a href="#rfc.section.8">8.</a>&nbsp;&nbsp;&nbsp;<a href="#iana.considerations">IANA Considerations</a><ul>
415               <li><a href="#rfc.section.8.1">8.1</a>&nbsp;&nbsp;&nbsp;<a href="#registry">Registry for Disposition Values and Parameters</a></li>
416               <li><a href="#rfc.section.8.2">8.2</a>&nbsp;&nbsp;&nbsp;<a href="#header.field.registration">Header Field Registration</a></li>
[982]417            </ul>
418         </li>
[2726]419         <li><a href="#rfc.section.9">9.</a>&nbsp;&nbsp;&nbsp;<a href="#rfc.section.9">Acknowledgements</a></li>
420         <li><a href="#rfc.section.10">10.</a>&nbsp;&nbsp;&nbsp;<a href="#rfc.references">References</a><ul>
421               <li><a href="#rfc.section.10.1">10.1</a>&nbsp;&nbsp;&nbsp;<a href="#rfc.references.1">Normative References</a></li>
422               <li><a href="#rfc.section.10.2">10.2</a>&nbsp;&nbsp;&nbsp;<a href="#rfc.references.2">Informative References</a></li>
[982]423            </ul>
424         </li>
[2726]425         <li><a href="#rfc.section.A">A.</a>&nbsp;&nbsp;&nbsp;<a href="#changes.from.rfc2616">Changes from the RFC 2616 Definition</a></li>
426         <li><a href="#rfc.section.B">B.</a>&nbsp;&nbsp;&nbsp;<a href="#diffs.compared.to.rfc2183">Differences Compared to RFC 2183</a></li>
427         <li><a href="#rfc.section.C">C.</a>&nbsp;&nbsp;&nbsp;<a href="#alternatives">Alternative Approaches to Internationalization</a><ul>
428               <li><a href="#rfc.section.C.1">C.1</a>&nbsp;&nbsp;&nbsp;<a href="#alternatives.rfc2047">RFC 2047 Encoding</a></li>
429               <li><a href="#rfc.section.C.2">C.2</a>&nbsp;&nbsp;&nbsp;<a href="#alternatives.percent">Percent Encoding</a></li>
430               <li><a href="#rfc.section.C.3">C.3</a>&nbsp;&nbsp;&nbsp;<a href="#alternatives.sniff">Encoding Sniffing</a></li>
[982]431            </ul>
432         </li>
[2726]433         <li><a href="#rfc.section.D">D.</a>&nbsp;&nbsp;&nbsp;<a href="#advice.generating">Advice on Generating Content-Disposition Header Fields</a></li>
434         <li><a href="#rfc.authors">Author's Address</a></li>
[982]435      </ul>
[2726]436      <div id="introduction">
437         <h1 id="rfc.section.1" class="np"><a href="#rfc.section.1">1.</a>&nbsp;<a href="#introduction">Introduction</a></h1>
438         <p id="rfc.section.1.p.1">RFC 2616 defines the Content-Disposition response header field (<a href="https://tools.ietf.org/html/rfc2616#section-19.5.1">Section 19.5.1</a> of <a href="#RFC2616" id="rfc.xref.RFC2616.1"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a>) but points out that it is not part of the HTTP/1.1 Standard (<a href="https://tools.ietf.org/html/rfc2616#section-15.5" id="rfc.xref.RFC2616.2">Section 15.5</a>):
439         </p>
440         <blockquote id="rfc.section.1.p.2" cite="http://tools.ietf.org/html/rfc2616#section-15.5">
441            <p>Content-Disposition is not part of the HTTP standard, but since it is widely implemented, we are documenting its use and risks
442               for implementers.
443            </p> 
444         </blockquote>
445         <p id="rfc.section.1.p.3">This specification takes over the definition and registration of Content-Disposition, as used in HTTP. Based on interoperability
446            testing with existing user agents (UAs), it fully defines a profile of the features defined in the Multipurpose Internet Mail
447            Extensions (MIME) variant (<a href="#RFC2183" id="rfc.xref.RFC2183.1"><cite title="Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field">[RFC2183]</cite></a>) of the header field, and also clarifies internationalization aspects.
448         </p>
449         <div class="note" id="rfc.section.1.p.4">
450            <p><b>Note:</b> This document does not apply to Content-Disposition header fields appearing in payload bodies transmitted over HTTP, such
451               as when using the media type "multipart/form-data" (<a href="#RFC2388" id="rfc.xref.RFC2388.1"><cite title="Returning Values from Forms: multipart/form-data">[RFC2388]</cite></a>).
452            </p> 
453         </div>
[1078]454      </div>
[2726]455      <div id="notational.conventions">
456         <h1 id="rfc.section.2"><a href="#rfc.section.2">2.</a>&nbsp;<a href="#notational.conventions">Notational Conventions</a></h1>
457         <p id="rfc.section.2.p.1">The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL"
458            in this document are to be interpreted as described in <a href="#RFC2119" id="rfc.xref.RFC2119.1"><cite title="Key words for use in RFCs to Indicate Requirement Levels">[RFC2119]</cite></a>.
459         </p>
460         <p id="rfc.section.2.p.2">This specification uses the augmented BNF (ABNF) notation defined in <a href="https://tools.ietf.org/html/rfc2616#section-2.1">Section 2.1</a> of <a href="#RFC2616" id="rfc.xref.RFC2616.3"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a>, including its rules for implied linear whitespace (LWS).
461         </p>
462      </div>
463      <div id="conformance.and.error.handling">
464         <h1 id="rfc.section.3"><a href="#rfc.section.3">3.</a>&nbsp;<a href="#conformance.and.error.handling">Conformance and Error Handling</a></h1>
465         <p id="rfc.section.3.p.1">This specification defines conformance criteria for both senders (usually, HTTP origin servers) and recipients (usually, HTTP
466            user agents) of the Content-Disposition header field. An implementation is considered conformant if it complies with all of
467            the requirements associated with its role.
468         </p>
469         <p id="rfc.section.3.p.2">This specification also defines certain forms of the header field value to be invalid, using both ABNF and prose requirements
470            (<a href="#header.field.definition" id="rfc.xref.header.field.definition.1" title="Header Field Definition">Section&nbsp;4</a>), but it does not define special handling of these invalid field values.
471         </p>
472         <p id="rfc.section.3.p.3">Senders <em class="bcp14">MUST NOT</em> generate Content-Disposition header fields that are invalid.
473         </p>
474         <p id="rfc.section.3.p.4">Recipients <em class="bcp14">MAY</em> take steps to recover a usable field value from an invalid header field, but <em class="bcp14">SHOULD NOT</em> reject the message outright, unless this is explicitly desirable behavior (e.g., the implementation is a validator). As such,
475            the default handling of invalid fields is to ignore them.
476         </p>
477      </div>
478      <div id="header.field.definition">
479         <div id="rfc.iref.h.1"></div>
480         <div id="rfc.iref.c.1"></div>
481         <h1 id="rfc.section.4"><a href="#rfc.section.4">4.</a>&nbsp;<a href="#header.field.definition">Header Field Definition</a></h1>
482         <p id="rfc.section.4.p.1">The Content-Disposition response header field is used to convey additional information about how to process the response payload,
483            and also can be used to attach additional metadata, such as the filename to use when saving the response payload locally.
484         </p>
485         <div>
486            <h2 id="rfc.section.4.1"><a href="#rfc.section.4.1">4.1</a>&nbsp;Grammar
487            </h2>
488            <div id="rfc.figure.u.1"></div><pre class="inline">  content-disposition = "Content-Disposition" ":"
[982]489                         disposition-type *( ";" disposition-parm )
490
491  disposition-type    = "inline" | "attachment" | disp-ext-type
492                      ; case-insensitive
493  disp-ext-type       = token
494
495  disposition-parm    = filename-parm | disp-ext-parm
496
497  filename-parm       = "filename" "=" value
498                      | "filename*" "=" ext-value
499 
500  disp-ext-parm       = token "=" value
501                      | ext-token "=" ext-value
502  ext-token           = &lt;the characters in token, followed by "*"&gt;
[2726]503</pre><div id="rfc.figure.u.2"></div>
504            <p>Defined in <a href="#RFC2616" id="rfc.xref.RFC2616.4"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a>:
505            </p><pre class="inline">  token         = &lt;token, defined in <a href="#RFC2616" id="rfc.xref.RFC2616.5"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a>, <a href="https://tools.ietf.org/html/rfc2616#section-2.2">Section 2.2</a>&gt;
506  quoted-string = &lt;quoted-string, defined in <a href="#RFC2616" id="rfc.xref.RFC2616.6"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a>, <a href="https://tools.ietf.org/html/rfc2616#section-2.2">Section 2.2</a>&gt;
507  value         = &lt;value, defined in <a href="#RFC2616" id="rfc.xref.RFC2616.7"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a>, <a href="https://tools.ietf.org/html/rfc2616#section-3.6">Section 3.6</a>&gt;
[1060]508                ; token | quoted-string
509             
[2726]510</pre><div id="rfc.figure.u.3"></div>
511            <p>Defined in <a href="#RFC5987" id="rfc.xref.RFC5987.1"><cite title="Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters">[RFC5987]</cite></a>:
512            </p><pre class="inline">  ext-value   = &lt;ext-value, defined in <a href="#RFC5987" id="rfc.xref.RFC5987.2"><cite title="Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters">[RFC5987]</cite></a>, <a href="https://tools.ietf.org/html/rfc5987#section-3.2">Section 3.2</a>&gt;
[1203]513</pre><p id="rfc.section.4.1.p.4">Content-Disposition header field values with multiple instances of the same parameter name are invalid.</p>
[2726]514            <p id="rfc.section.4.1.p.5">Note that due to the rules for implied linear whitespace (<a href="https://tools.ietf.org/html/rfc2616#section-2.1">Section 2.1</a> of <a href="#RFC2616" id="rfc.xref.RFC2616.8"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a>), <em class="bcp14">OPTIONAL</em> whitespace can appear between words (token or quoted-string) and separator characters.
[982]515            </p>
[2726]516            <p id="rfc.section.4.1.p.6">Furthermore, note that the format used for ext-value allows specifying a natural language (e.g., "en"); this is of limited
517               use for filenames and is likely to be ignored by recipients.
[982]518            </p>
[2726]519         </div>
520         <div id="disposition.type">
521            <h2 id="rfc.section.4.2"><a href="#rfc.section.4.2">4.2</a>&nbsp;<a href="#disposition.type">Disposition Type</a></h2>
522            <p id="rfc.section.4.2.p.1">If the disposition type matches "attachment" (case-insensitively), this indicates that the recipient should prompt the user
523               to save the response locally, rather than process it normally (as per its media type).
[1022]524            </p>
[2726]525            <p id="rfc.section.4.2.p.2">On the other hand, if it matches "inline" (case-insensitively), this implies default processing. Therefore, the disposition
526               type "inline" is only useful when it is augmented with additional parameters, such as the filename (see below).
[982]527            </p>
[2726]528            <p id="rfc.section.4.2.p.3">Unknown or unhandled disposition types <em class="bcp14">SHOULD</em> be handled by recipients the same way as "attachment" (see also <a href="#RFC2183" id="rfc.xref.RFC2183.2"><cite title="Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field">[RFC2183]</cite></a>, <a href="https://tools.ietf.org/html/rfc2183#section-2.8">Section 2.8</a>).
529            </p>
530         </div>
531         <div id="disposition.parameter.filename">
532            <h2 id="rfc.section.4.3"><a href="#rfc.section.4.3">4.3</a>&nbsp;<a href="#disposition.parameter.filename">Disposition Parameter: 'Filename'</a></h2>
533            <p id="rfc.section.4.3.p.1">The parameters "filename" and "filename*", to be matched case-insensitively, provide information on how to construct a filename
534               for storing the message payload.
535            </p>
536            <p id="rfc.section.4.3.p.2">Depending on the disposition type, this information might be used right away (in the "save as..." interaction caused for the
537               "attachment" disposition type), or later on (for instance, when the user decides to save the contents of the current page
538               being displayed).
539            </p>
540            <p id="rfc.section.4.3.p.3">The parameters "filename" and "filename*" differ only in that "filename*" uses the encoding defined in <a href="#RFC5987" id="rfc.xref.RFC5987.3"><cite title="Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters">[RFC5987]</cite></a>, allowing the use of characters not present in the ISO-8859-1 character set (<a href="#ISO-8859-1" id="rfc.xref.ISO-8859-1.1"><cite title="Information technology -- 8-bit single-byte coded graphic character sets -- Part 1: Latin alphabet No.&nbsp;1">[ISO-8859-1]</cite></a>).
541            </p>
542            <p id="rfc.section.4.3.p.4">Many user agent implementations predating this specification do not understand the "filename*" parameter. Therefore, when
543               both "filename" and "filename*" are present in a single header field value, recipients <em class="bcp14">SHOULD</em> pick "filename*" and ignore "filename". This way, senders can avoid special-casing specific user agents by sending both the
544               more expressive "filename*" parameter, and the "filename" parameter as fallback for legacy recipients (see <a href="#examples" title="Examples">Section&nbsp;5</a> for an example).
545            </p>
546            <p id="rfc.section.4.3.p.5">It is essential that recipients treat the specified filename as advisory only, and thus be very careful in extracting the
547               desired information. In particular:
548            </p>
549            <ul>
550               <li>
551                  <p>Recipients <em class="bcp14">MUST NOT</em> be able to write into any location other than one to which they are specifically entitled. To illustrate the problem, consider
552                     the consequences of being able to overwrite well-known system locations (such as "/etc/passwd"). One strategy to achieve this
553                     is to never trust folder name information in the filename parameter, for instance by stripping all but the last path segment
554                     and only considering the actual filename (where 'path segments' are the components of the field value delimited by the path
555                     separator characters "\" and "/").
556                  </p>
557               </li>
558               <li>
559                  <p>Many platforms do not use Internet Media Types (<a href="#RFC2046" id="rfc.xref.RFC2046.1"><cite title="Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types">[RFC2046]</cite></a>) to hold type information in the file system, but rely on filename extensions instead. Trusting the server-provided file
560                     extension could introduce a privilege escalation when the saved file is later opened (consider ".exe"). Thus, recipients that
561                     make use of file extensions to determine the media type <em class="bcp14">MUST</em> ensure that a file extension is used that is safe, optimally matching the media type of the received payload.
562                  </p>
563               </li>
564               <li>
565                  <p>Recipients <em class="bcp14">SHOULD</em> strip or replace character sequences that are known to cause confusion both in user interfaces and in filenames, such as control
566                     characters and leading and trailing whitespace.
567                  </p>
568               </li>
569               <li>
570                  <p>Other aspects recipients need to be aware of are names that have a special meaning in the file system or in shell commands,
571                     such as "." and "..", "~", "|", and also device names. Recipients <em class="bcp14">SHOULD</em> ignore or substitute names like these.
572                  </p>
573               </li>
574            </ul>
575            <div class="note" id="rfc.section.4.3.p.6">
576               <p><b>Note:</b> Many user agents do not properly handle the escape character "\" when using the quoted-string form. Furthermore, some user
577                  agents erroneously try to perform unescaping of "percent" escapes (see <a href="#alternatives.percent" title="Percent Encoding">Appendix&nbsp;C.2</a>), and thus might misinterpret filenames containing the percent character followed by two hex digits.
578               </p> 
579            </div>
580         </div>
581         <div id="disposition.parameter.extensions">
582            <h2 id="rfc.section.4.4"><a href="#rfc.section.4.4">4.4</a>&nbsp;<a href="#disposition.parameter.extensions">Disposition Parameter: Extensions</a></h2>
583            <p id="rfc.section.4.4.p.1">To enable future extensions, recipients <em class="bcp14">SHOULD</em> ignore unrecognized parameters (see also <a href="#RFC2183" id="rfc.xref.RFC2183.3"><cite title="Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field">[RFC2183]</cite></a>, <a href="https://tools.ietf.org/html/rfc2183#section-2.8">Section 2.8</a>).
584            </p>
585         </div>
586         <div id="extensibility">
587            <h2 id="rfc.section.4.5"><a href="#rfc.section.4.5">4.5</a>&nbsp;<a href="#extensibility">Extensibility</a></h2>
588            <p id="rfc.section.4.5.p.1">Note that <a href="https://tools.ietf.org/html/rfc2183#section-9">Section 9</a> of <a href="#RFC2183" id="rfc.xref.RFC2183.4"><cite title="Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field">[RFC2183]</cite></a> defines IANA registries both for disposition types and disposition parameters. This registry is shared by different protocols
589               using Content-Disposition, such as MIME and HTTP. Therefore, not all registered values may make sense in the context of HTTP.
590            </p>
591         </div>
[1041]592      </div>
[2726]593      <div id="examples">
594         <h1 id="rfc.section.5"><a href="#rfc.section.5">5.</a>&nbsp;<a href="#examples">Examples</a></h1>
595         <div id="rfc.figure.u.4"></div>
596         <p>Direct the UA to show "save as" dialog, with a filename of "example.html":</p><pre class="text">Content-Disposition: Attachment; filename=example.html
597</pre><div id="rfc.figure.u.5"></div>
598         <p>Direct the UA to behave as if the Content-Disposition header field wasn't present, but to remember the filename "an example.html"
599            for a subsequent save operation:
600         </p><pre class="text">Content-Disposition: INLINE; FILENAME= "an example.html"
601</pre><p>Note: This uses the quoted-string form so that the space character can be included.</p>
602         <div id="rfc.figure.u.6"></div>
603         <p>Direct the UA to show "save as" dialog, with a filename containing the Unicode character U+20AC (EURO SIGN):</p><pre class="text">Content-Disposition: attachment;
[997]604                     filename*= UTF-8''<b>%e2%82%ac</b>%20rates
[2726]605</pre><p>Here, the encoding defined in <a href="#RFC5987" id="rfc.xref.RFC5987.4"><cite title="Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters">[RFC5987]</cite></a> is also used to encode the non-ISO-8859-1 character.
606         </p>
607         <div id="rfc.figure.u.7"></div>
608         <p>This example is the same as the one above, but adding the "filename" parameter for compatibility with user agents not implementing
609            RFC&nbsp;5987:
610         </p><pre class="text">Content-Disposition: attachment;
[997]611                     filename="EURO rates";
612                     filename*=utf-8''<b>%e2%82%ac</b>%20rates
[2726]613</pre><p>Note: Those user agents that do not support the RFC 5987 encoding ignore "filename*" when it occurs after "filename".</p>
614      </div>
615      <div id="i18n">
616         <h1 id="rfc.section.6"><a href="#rfc.section.6">6.</a>&nbsp;<a href="#i18n">Internationalization Considerations</a></h1>
617         <p id="rfc.section.6.p.1">The "filename*" parameter (<a href="#disposition.parameter.filename" title="Disposition Parameter: 'Filename'">Section&nbsp;4.3</a>), using the encoding defined in <a href="#RFC5987" id="rfc.xref.RFC5987.5"><cite title="Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters">[RFC5987]</cite></a>, allows the server to transmit characters outside the ISO-8859-1 character set, and also to optionally specify the language
618            in use.
619         </p>
620         <p id="rfc.section.6.p.2">Future parameters might also require internationalization, in which case the same encoding can be used.</p>
621      </div>
622      <div id="security.considerations">
623         <h1 id="rfc.section.7"><a href="#rfc.section.7">7.</a>&nbsp;<a href="#security.considerations">Security Considerations</a></h1>
624         <p id="rfc.section.7.p.1">Using server-supplied information for constructing local filenames introduces many risks. These are summarized in <a href="#disposition.parameter.filename" title="Disposition Parameter: 'Filename'">Section&nbsp;4.3</a>.
625         </p>
626         <p id="rfc.section.7.p.2">Furthermore, implementers ought to be aware of the security considerations applying to HTTP (see <a href="https://tools.ietf.org/html/rfc2616#section-15">Section 15</a> of <a href="#RFC2616" id="rfc.xref.RFC2616.9"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a>), and also the parameter encoding defined in <a href="#RFC5987" id="rfc.xref.RFC5987.6"><cite title="Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters">[RFC5987]</cite></a> (see <a href="https://tools.ietf.org/html/rfc5987#section-5" id="rfc.xref.RFC5987.7">Section 5</a>).
627         </p>
628      </div>
629      <div id="iana.considerations">
630         <h1 id="rfc.section.8"><a href="#rfc.section.8">8.</a>&nbsp;<a href="#iana.considerations">IANA Considerations</a></h1>
631         <div id="registry">
632            <h2 id="rfc.section.8.1"><a href="#rfc.section.8.1">8.1</a>&nbsp;<a href="#registry">Registry for Disposition Values and Parameters</a></h2>
633            <p id="rfc.section.8.1.p.1">This specification does not introduce any changes to the registration procedures for disposition values and parameters that
634               are defined in <a href="https://tools.ietf.org/html/rfc2183#section-9">Section 9</a> of <a href="#RFC2183" id="rfc.xref.RFC2183.5"><cite title="Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field">[RFC2183]</cite></a>.
635            </p>
636         </div>
637         <div id="header.field.registration">
638            <h2 id="rfc.section.8.2"><a href="#rfc.section.8.2">8.2</a>&nbsp;<a href="#header.field.registration">Header Field Registration</a></h2>
639            <p id="rfc.section.8.2.p.1">This document updates the definition of the Content-Disposition HTTP header field in the permanent HTTP header field registry
640               (see <a href="#RFC3864" id="rfc.xref.RFC3864.1"><cite title="Registration Procedures for Message Header Fields">[RFC3864]</cite></a>).
641            </p>
642            <p id="rfc.section.8.2.p.2"></p>
643            <dl>
644               <dt>Header field name:</dt>
645               <dd>Content-Disposition</dd>
646               <dt>Applicable protocol:</dt>
647               <dd>http</dd>
648               <dt>Status:</dt>
649               <dd>standard</dd>
650               <dt>Author/Change controller:</dt>
651               <dd>IETF</dd>
652               <dt>Specification document:</dt>
653               <dd>this specification (<a href="#header.field.definition" id="rfc.xref.header.field.definition.2" title="Header Field Definition">Section&nbsp;4</a>)
654               </dd>
655               <dt>Related information:</dt>
656               <dd>none</dd>
657            </dl>
658         </div>
659      </div>
660      <div>
661         <h1 id="rfc.section.9"><a href="#rfc.section.9">9.</a>&nbsp;Acknowledgements
662         </h1>
663         <p id="rfc.section.9.p.1">Thanks to Adam Barth, Rolf Eike Beer, Stewart Bryant, Bjoern Hoehrmann, Alfred Hoenes, Roar Lauritzsen, Alexey Melnikov, Henrik
664            Nordstrom, and Mark Nottingham for their valuable feedback.
665         </p>
666      </div>
[1115]667      <h1 id="rfc.references"><a id="rfc.section.10" href="#rfc.section.10">10.</a> References
[982]668      </h1>
[1115]669      <h2 id="rfc.references.1"><a href="#rfc.section.10.1" id="rfc.section.10.1">10.1</a> Normative References
[982]670      </h2>
[2726]671      <table>
[982]672         <tr>
673            <td class="reference"><b id="ISO-8859-1">[ISO-8859-1]</b></td>
[1294]674            <td class="top">International Organization for Standardization, “Information technology -- 8-bit single-byte coded graphic character sets -- Part 1: Latin alphabet No.&nbsp;1”, ISO/IEC&nbsp;8859-1:1998, 1998.</td>
[982]675         </tr>
676         <tr>
677            <td class="reference"><b id="RFC2119">[RFC2119]</b></td>
[2726]678            <td class="top"><a href="mailto:sob@harvard.edu" title="Harvard University">Bradner, S.</a>, “<a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>”, BCP&nbsp;14, RFC&nbsp;2119, March&nbsp;1997.
[982]679            </td>
680         </tr>
681         <tr>
682            <td class="reference"><b id="RFC2616">[RFC2616]</b></td>
[2726]683            <td class="top"><a href="mailto:fielding@ics.uci.edu" title="University of California, Irvine">Fielding, R.</a>, <a href="mailto:jg@w3.org" title="W3C">Gettys, J.</a>, <a href="mailto:mogul@wrl.dec.com" title="Compaq Computer Corporation">Mogul, J.</a>, <a href="mailto:frystyk@w3.org" title="MIT Laboratory for Computer Science">Frystyk, H.</a>, <a href="mailto:masinter@parc.xerox.com" title="Xerox Corporation">Masinter, L.</a>, <a href="mailto:paulle@microsoft.com" title="Microsoft Corporation">Leach, P.</a>, and <a href="mailto:timbl@w3.org" title="W3C">T. Berners-Lee</a>, “<a href="https://tools.ietf.org/html/rfc2616">Hypertext Transfer Protocol -- HTTP/1.1</a>”, RFC&nbsp;2616, June&nbsp;1999.
[982]684            </td>
685         </tr>
686         <tr>
687            <td class="reference"><b id="RFC5987">[RFC5987]</b></td>
[2726]688            <td class="top"><a href="mailto:julian.reschke@greenbytes.de" title="greenbytes GmbH">Reschke, J.</a>, “<a href="https://tools.ietf.org/html/rfc5987">Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters</a>”, RFC&nbsp;5987, August&nbsp;2010.
[982]689            </td>
690         </tr>
691      </table>
[1115]692      <h2 id="rfc.references.2"><a href="#rfc.section.10.2" id="rfc.section.10.2">10.2</a> Informative References
[982]693      </h2>
[2726]694      <table>
[982]695         <tr>
696            <td class="reference"><b id="RFC2046">[RFC2046]</b></td>
[2726]697            <td class="top"><a href="mailto:ned@innosoft.com" title="Innosoft International, Inc.">Freed, N.</a> and <a href="mailto:nsb@nsb.fv.com" title="First Virtual Holdings">N. Borenstein</a>, “<a href="https://tools.ietf.org/html/rfc2046">Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types</a>”, RFC&nbsp;2046, November&nbsp;1996.
[982]698            </td>
699         </tr>
700         <tr>
701            <td class="reference"><b id="RFC2047">[RFC2047]</b></td>
[2726]702            <td class="top"><a href="mailto:moore@cs.utk.edu" title="University of Tennessee">Moore, K.</a>, “<a href="https://tools.ietf.org/html/rfc2047">MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text</a>”, RFC&nbsp;2047, November&nbsp;1996.
[982]703            </td>
704         </tr>
705         <tr>
706            <td class="reference"><b id="RFC2183">[RFC2183]</b></td>
[2726]707            <td class="top"><a href="mailto:rens@century.com" title="New Century Systems">Troost, R.</a>, <a href="mailto:sdorner@qualcomm.com" title="QUALCOMM Incorporated">Dorner, S.</a>, and <a href="mailto:moore@cs.utk.edu" title="Department of Computer Science">K. Moore, Ed.</a>, “<a href="https://tools.ietf.org/html/rfc2183">Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field</a>”, RFC&nbsp;2183, August&nbsp;1997.
[982]708            </td>
709         </tr>
710         <tr>
711            <td class="reference"><b id="RFC2231">[RFC2231]</b></td>
[2726]712            <td class="top"><a href="mailto:ned.freed@innosoft.com" title="Innosoft International, Inc.">Freed, N.</a> and <a href="mailto:moore@cs.utk.edu" title="University of Tennessee">K. Moore</a>, “<a href="https://tools.ietf.org/html/rfc2231">MIME Parameter Value and Encoded Word Extensions: Character Sets, Languages, and Continuations</a>”, RFC&nbsp;2231, November&nbsp;1997.
[982]713            </td>
714         </tr>
715         <tr>
[1078]716            <td class="reference"><b id="RFC2388">[RFC2388]</b></td>
[2726]717            <td class="top"><a href="mailto:masinter@parc.xerox.com" title="Xerox Palo Alto Research Center">Masinter, L.</a>, “<a href="https://tools.ietf.org/html/rfc2388">Returning Values from Forms: multipart/form-data</a>”, RFC&nbsp;2388, August&nbsp;1998.
[1078]718            </td>
719         </tr>
720         <tr>
[982]721            <td class="reference"><b id="RFC3864">[RFC3864]</b></td>
[2726]722            <td class="top"><a href="mailto:GK-IETF@ninebynine.org" title="Nine by Nine">Klyne, G.</a>, <a href="mailto:mnot@pobox.com" title="BEA Systems">Nottingham, M.</a>, and <a href="mailto:JeffMogul@acm.org" title="HP Labs">J. Mogul</a>, “<a href="https://tools.ietf.org/html/rfc3864">Registration Procedures for Message Header Fields</a>”, BCP&nbsp;90, RFC&nbsp;3864, September&nbsp;2004.
[982]723            </td>
724         </tr>
725         <tr>
726            <td class="reference"><b id="RFC3986">[RFC3986]</b></td>
[2726]727            <td class="top"><a href="mailto:timbl@w3.org" title="World Wide Web Consortium">Berners-Lee, T.</a>, <a href="mailto:fielding@gbiv.com" title="Day Software">Fielding, R.</a>, and <a href="mailto:LMM@acm.org" title="Adobe Systems Incorporated">L. Masinter</a>, “<a href="https://tools.ietf.org/html/rfc3986">Uniform Resource Identifier (URI): Generic Syntax</a>”, STD&nbsp;66, RFC&nbsp;3986, January&nbsp;2005.
[982]728            </td>
729         </tr>
[1199]730         <tr>
731            <td class="reference"><b id="US-ASCII">[US-ASCII]</b></td>
732            <td class="top">American National Standards Institute, “Coded Character Set -- 7-bit American Standard Code for Information Interchange”, ANSI&nbsp;X3.4, 1986.</td>
733         </tr>
[982]734      </table>
[2726]735      <div id="changes.from.rfc2616">
736         <h1 id="rfc.section.A" class="np"><a href="#rfc.section.A">A.</a>&nbsp;<a href="#changes.from.rfc2616">Changes from the RFC 2616 Definition</a></h1>
737         <p id="rfc.section.A.p.1">Compared to <a href="https://tools.ietf.org/html/rfc2616#section-19.5.1">Section 19.5.1</a> of <a href="#RFC2616" id="rfc.xref.RFC2616.10"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a>, the following normative changes reflecting actual implementations have been made:
738         </p>
739         <ul>
740            <li>According to RFC 2616, the disposition type "attachment" only applies to content of type "application/octet-stream". This
741               restriction has been removed, because recipients in practice do not check the content type, and it also discourages properly
742               declaring the media type.
743            </li>
744            <li>RFC 2616 only allows "quoted-string" for the filename parameter. This would be an exceptional parameter syntax, and also doesn't
745               reflect actual use.
746            </li>
747            <li>The definition for the disposition type "inline" (<a href="#RFC2183" id="rfc.xref.RFC2183.6"><cite title="Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field">[RFC2183]</cite></a>, <a href="https://tools.ietf.org/html/rfc2183#section-2.1">Section 2.1</a>) has been re-added with a suggestion for its processing.
748            </li>
749            <li>This specification requires support for the extended parameter encoding defined in <a href="#RFC5987" id="rfc.xref.RFC5987.8"><cite title="Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters">[RFC5987]</cite></a>.
750            </li>
751         </ul>
752      </div>
753      <div id="diffs.compared.to.rfc2183">
754         <h1 id="rfc.section.B"><a href="#rfc.section.B">B.</a>&nbsp;<a href="#diffs.compared.to.rfc2183">Differences Compared to RFC 2183</a></h1>
755         <p id="rfc.section.B.p.1"><a href="https://tools.ietf.org/html/rfc2183#section-2">Section 2</a> of <a href="#RFC2183" id="rfc.xref.RFC2183.7"><cite title="Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field">[RFC2183]</cite></a> defines several additional disposition parameters: "creation-date", "modification-date", "quoted-date-time", and "size". The
756            majority of user agents do not implement these; thus, they have been omitted from this specification.
757         </p>
758      </div>
759      <div id="alternatives">
760         <h1 id="rfc.section.C"><a href="#rfc.section.C">C.</a>&nbsp;<a href="#alternatives">Alternative Approaches to Internationalization</a></h1>
761         <p id="rfc.section.C.p.1">By default, HTTP header field parameters cannot carry characters outside the ISO-8859-1 (<a href="#ISO-8859-1" id="rfc.xref.ISO-8859-1.2"><cite title="Information technology -- 8-bit single-byte coded graphic character sets -- Part 1: Latin alphabet No.&nbsp;1">[ISO-8859-1]</cite></a>) character encoding (see <a href="#RFC2616" id="rfc.xref.RFC2616.11"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a>, <a href="https://tools.ietf.org/html/rfc2616#section-2.2">Section 2.2</a>). For the "filename" parameter, this of course is an unacceptable restriction.
762         </p>
763         <p id="rfc.section.C.p.2">Unfortunately, user agent implementers have not managed to come up with an interoperable approach, although the IETF Standards
764            Track specifies exactly one solution (<a href="#RFC2231" id="rfc.xref.RFC2231.1"><cite title="MIME Parameter Value and Encoded Word Extensions: Character Sets, Languages, and Continuations">[RFC2231]</cite></a>, clarified and profiled for HTTP in <a href="#RFC5987" id="rfc.xref.RFC5987.9"><cite title="Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters">[RFC5987]</cite></a>).
765         </p>
766         <p id="rfc.section.C.p.3">For completeness, the sections below describe the various approaches that have been tried, and explain how they are inferior
767            to the RFC&nbsp;5987 encoding used in this specification.
768         </p>
769         <div id="alternatives.rfc2047">
770            <h2 id="rfc.section.C.1"><a href="#rfc.section.C.1">C.1</a>&nbsp;<a href="#alternatives.rfc2047">RFC 2047 Encoding</a></h2>
771            <p id="rfc.section.C.1.p.1">RFC 2047 defines an encoding mechanism for header fields, but this encoding is not supposed to be used for header field parameters
772               — see <a href="https://tools.ietf.org/html/rfc2047#section-5">Section 5</a> of <a href="#RFC2047" id="rfc.xref.RFC2047.1"><cite title="MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text">[RFC2047]</cite></a>:
773            </p>
774            <blockquote id="rfc.section.C.1.p.2" cite="http://tools.ietf.org/html/rfc2047#section-5">
775               <p>An 'encoded-word' MUST NOT appear within a 'quoted-string'.</p> 
776               <p>...</p> 
777               <p>An 'encoded-word' MUST NOT be used in parameter of a MIME Content-Type or Content-Disposition field, or in any structured
778                  field body except within a 'comment' or 'phrase'.
779               </p> 
780            </blockquote>
781            <p id="rfc.section.C.1.p.3">In practice, some user agents implement the encoding, some do not (exposing the encoded string to the user), and some get
782               confused by it.
783            </p>
784         </div>
785         <div id="alternatives.percent">
786            <h2 id="rfc.section.C.2"><a href="#rfc.section.C.2">C.2</a>&nbsp;<a href="#alternatives.percent">Percent Encoding</a></h2>
787            <p id="rfc.section.C.2.p.1">Some user agents accept percent-encoded (<a href="#RFC3986" id="rfc.xref.RFC3986.1"><cite title="Uniform Resource Identifier (URI): Generic Syntax">[RFC3986]</cite></a>, <a href="https://tools.ietf.org/html/rfc3986#section-2.1">Section 2.1</a>) sequences of characters. The character encoding being used for decoding depends on various factors, including the encoding
788               of the referring page, the user agent's locale, its configuration, and also the actual value of the parameter.
789            </p>
790            <p id="rfc.section.C.2.p.2">In practice, this is hard to use because those user agents that do not support it will display the escaped character sequence
791               to the user. For those user agents that do implement this, it is difficult to predict what character encoding they actually
792               expect.
793            </p>
794         </div>
795         <div id="alternatives.sniff">
796            <h2 id="rfc.section.C.3"><a href="#rfc.section.C.3">C.3</a>&nbsp;<a href="#alternatives.sniff">Encoding Sniffing</a></h2>
797            <p id="rfc.section.C.3.p.1">Some user agents inspect the value (which defaults to ISO-8859-1 for the quoted-string form) and switch to UTF-8 when it seems
798               to be more likely to be the correct interpretation.
799            </p>
800            <p id="rfc.section.C.3.p.2">As with the approaches above, this is not interoperable and, furthermore, risks misinterpreting the actual value.</p>
801         </div>
802      </div>
803      <div id="advice.generating">
804         <h1 id="rfc.section.D"><a href="#rfc.section.D">D.</a>&nbsp;<a href="#advice.generating">Advice on Generating Content-Disposition Header Fields</a></h1>
805         <p id="rfc.section.D.p.1">To successfully interoperate with existing and future user agents, senders of the Content-Disposition header field are advised
806            to:
807         </p>
808         <p id="rfc.section.D.p.2"></p>
809         <ul>
810            <li>Include a "filename" parameter when US-ASCII (<a href="#US-ASCII" id="rfc.xref.US-ASCII.1"><cite title="Coded Character Set -- 7-bit American Standard Code for Information Interchange">[US-ASCII]</cite></a>) is sufficiently expressive.
811            </li>
812            <li>Use the 'token' form of the filename parameter only when it does not contain disallowed characters (e.g., spaces); in such
813               cases, the quoted-string form should be used.
814            </li>
815            <li>Avoid including the percent character followed by two hexadecimal characters (e.g., %A9) in the filename parameter, since
816               some existing implementations consider it to be an escape character, while others will pass it through unchanged.
817            </li>
818            <li>Avoid including the "\" character in the quoted-string form of the filename parameter, as escaping is not implemented by some
819               user agents, and "\" can be considered an illegal path character.
820            </li>
821            <li>Avoid using non-ASCII characters in the filename parameter. Although most existing implementations will decode them as ISO‑8859‑1,
822               some will apply heuristics to detect UTF-8, and thus might fail on certain names.
823            </li>
824            <li>Include a "filename*" parameter where the desired filename cannot be expressed faithfully using the "filename" form. Note
825               that legacy user agents will not process this, and will fall back to using the "filename" parameter's content.
826            </li>
827            <li>When a "filename*" parameter is sent, to also generate a "filename" parameter as a fallback for user agents that do not support
828               the "filename*" form, if possible. This can be done by substituting characters with US-ASCII sequences (e.g., Unicode character
829               point U+00E4 (LATIN SMALL LETTER A WITH DIARESIS) by "ae"). Note that this may not be possible in some locales.
830            </li>
831            <li>When a "filename" parameter is included as a fallback (as per above), "filename" should occur first, due to parsing problems
832               in some existing implementations.
833            </li>
834            <li>Use UTF-8 as the encoding of the "filename*" parameter, when present, because at least one existing implementation only implements
835               that encoding.
836            </li>
837         </ul>
838         <p id="rfc.section.D.p.3">Note that this advice is based upon UA behavior at the time of writing, and might be superseded. At the time of publication
839            of this document, &lt;<a href="http://purl.org/NET/http/content-disposition-tests">http://purl.org/NET/http/content-disposition-tests</a>&gt; provides an overview of current levels of support in various implementations.
840         </p>
841      </div>
[982]842      <div class="avoidbreak">
843         <h1 id="rfc.authors"><a href="#rfc.authors">Author's Address</a></h1>
[2726]844         <p><b>Julian F. Reschke</b><br>greenbytes GmbH<br>Hafenweg 16<br>Muenster, NW&nbsp;48155<br>Germany<br>Email: <a href="mailto:julian.reschke@greenbytes.de">julian.reschke@greenbytes.de</a><br>URI: <a href="http://greenbytes.de/tech/webdav/">http://greenbytes.de/tech/webdav/</a></p>
[982]845      </div>
846   </body>
847</html>
Note: See TracBrowser for help on using the repository browser.