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

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

apply RFC-Editor AUTH48 changes

  • Property svn:eol-style set to native
File size: 56.4 KB
Line 
1<!DOCTYPE html
2  PUBLIC "-//W3C//DTD HTML 4.01//EN">
3<html lang="en">
4   <head profile="http://www.w3.org/2006/03/hcard http://dublincore.org/documents/2008/08/04/dc-html/">
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;
35  font-family: verdana, helvetica, arial, sans-serif;
36  font-size: 10pt;
37}
38cite {
39  font-style: normal;
40}
41div.note {
42  margin-left: 2em;
43}
44dd {
45  margin-right: 2em;
46}
47dl {
48  margin-left: 2em;
49}
50
51ul.empty {
52  list-style-type: none;
53}
54ul.empty li {
55  margin-top: .5em;
56}
57dl p {
58  margin-left: 0em;
59}
60dt {
61  margin-top: .5em;
62}
63h1 {
64  font-size: 14pt;
65  line-height: 21pt;
66  page-break-after: avoid;
67}
68h1.np {
69  page-break-before: always;
70}
71h1 a {
72  color: #333333;
73}
74h2 {
75  font-size: 12pt;
76  line-height: 15pt;
77  page-break-after: avoid;
78}
79h3, h4, h5, h6 {
80  font-size: 10pt;
81  page-break-after: avoid;
82}
83h2 a, h3 a, h4 a, h5 a, h6 a {
84  color: black;
85}
86img {
87  margin-left: 3em;
88}
89li {
90  margin-left: 2em;
91  margin-right: 2em;
92}
93ol {
94  margin-left: 2em;
95  margin-right: 2em;
96}
97ol.la {
98  list-style-type: lower-alpha;
99}
100ol.ua {
101  list-style-type: upper-alpha;
102}
103ol p {
104  margin-left: 0em;
105}
106p {
107  margin-left: 2em;
108  margin-right: 2em;
109}
110pre {
111  margin-left: 3em;
112  background-color: lightyellow;
113  padding: .25em;
114}
115pre.text2 {
116  border-style: dotted;
117  border-width: 1px;
118  background-color: #f0f0f0;
119  width: 69em;
120}
121pre.inline {
122  background-color: white;
123  padding: 0em;
124}
125pre.text {
126  border-style: dotted;
127  border-width: 1px;
128  background-color: #f8f8f8;
129  width: 69em;
130}
131pre.drawing {
132  border-style: solid;
133  border-width: 1px;
134  background-color: #f8f8f8;
135  padding: 2em;
136}
137table {
138  margin-left: 2em;
139}
140table.header {
141  border-spacing: 1px;
142  width: 95%;
143  font-size: 10pt;
144  color: white;
145}
146td.top {
147  vertical-align: top;
148}
149td.topnowrap {
150  vertical-align: top;
151  white-space: nowrap; 
152}
153table.header td {
154  background-color: gray;
155  width: 50%;
156}
157table.header a {
158  color: white;
159}
160td.reference {
161  vertical-align: top;
162  white-space: nowrap;
163  padding-right: 1em;
164}
165thead {
166  display:table-header-group;
167}
168ul.toc, ul.toc ul {
169  list-style: none;
170  margin-left: 1.5em;
171  margin-right: 0em;
172  padding-left: 0em;
173}
174ul.toc li {
175  line-height: 150%;
176  font-weight: bold;
177  font-size: 10pt;
178  margin-left: 0em;
179  margin-right: 0em;
180}
181ul.toc li li {
182  line-height: normal;
183  font-weight: normal;
184  font-size: 9pt;
185  margin-left: 0em;
186  margin-right: 0em;
187}
188li.excluded {
189  font-size: 0pt;
190}
191ul p {
192  margin-left: 0em;
193}
194ul.ind, ul.ind ul {
195  list-style: none;
196  margin-left: 1.5em;
197  margin-right: 0em;
198  padding-left: 0em;
199  page-break-before: avoid;
200}
201ul.ind li {
202  font-weight: bold;
203  line-height: 200%;
204  margin-left: 0em;
205  margin-right: 0em;
206}
207ul.ind li li {
208  font-weight: normal;
209  line-height: 150%;
210  margin-left: 0em;
211  margin-right: 0em;
212}
213.avoidbreak {
214  page-break-inside: avoid;
215}
216.bcp14 {
217  font-style: normal;
218  text-transform: lowercase;
219  font-variant: small-caps;
220}
221blockquote > * .bcp14 {
222  font-style: italic;
223}
224.comment {
225  background-color: yellow;
226}
227.center {
228  text-align: center;
229}
230.error {
231  color: red;
232  font-style: italic;
233  font-weight: bold;
234}
235.figure {
236  font-weight: bold;
237  text-align: center;
238  font-size: 9pt;
239}
240.filename {
241  color: #333333;
242  font-weight: bold;
243  font-size: 12pt;
244  line-height: 21pt;
245  text-align: center;
246}
247.fn {
248  font-weight: bold;
249}
250.hidden {
251  display: none;
252}
253.left {
254  text-align: left;
255}
256.right {
257  text-align: right;
258}
259.title {
260  color: #990000;
261  font-size: 18pt;
262  line-height: 18pt;
263  font-weight: bold;
264  text-align: center;
265  margin-top: 36pt;
266}
267.vcardline {
268  display: block;
269}
270.warning {
271  font-size: 14pt;
272  background-color: yellow;
273}
274
275
276@media print {
277  .noprint {
278    display: none;
279  }
280 
281  a {
282    color: black;
283    text-decoration: none;
284  }
285
286  table.header {
287    width: 90%;
288  }
289
290  td.header {
291    width: 50%;
292    color: black;
293    background-color: white;
294    vertical-align: top;
295    font-size: 12pt;
296  }
297
298  ul.toc a::after {
299    content: leader('.') target-counter(attr(href), page);
300  }
301 
302  ul.ind li li a {
303    content: target-counter(attr(href), page);
304  }
305 
306  .print2col {
307    column-count: 2;
308    -moz-column-count: 2;
309    column-fill: auto;
310  }
311}
312
313@page {
314  @top-left {
315       content: "Internet-Draft"; 
316  } 
317  @top-right {
318       content: "May 2011"; 
319  } 
320  @top-center {
321       content: "Content-Disposition in HTTP"; 
322  } 
323  @bottom-left {
324       content: "Reschke"; 
325  } 
326  @bottom-center {
327       content: "Expires November 28, 2011"; 
328  } 
329  @bottom-right {
330       content: "[Page " counter(page) "]"; 
331  } 
332}
333
334@page:first { 
335    @top-left {
336      content: normal;
337    }
338    @top-right {
339      content: normal;
340    }
341    @top-center {
342      content: normal;
343    }
344}
345</style><link rel="Contents" href="#rfc.toc">
346      <link rel="Author" href="#rfc.authors">
347      <link rel="Copyright" href="#rfc.copyrightnotice">
348      <link rel="Index" href="#rfc.index">
349      <link rel="Chapter" title="1 Introduction" href="#rfc.section.1">
350      <link rel="Chapter" title="2 Notational Conventions" href="#rfc.section.2">
351      <link rel="Chapter" title="3 Conformance and Error Handling" href="#rfc.section.3">
352      <link rel="Chapter" title="4 Header Field Definition" href="#rfc.section.4">
353      <link rel="Chapter" title="5 Examples" href="#rfc.section.5">
354      <link rel="Chapter" title="6 Internationalization Considerations" href="#rfc.section.6">
355      <link rel="Chapter" title="7 Security Considerations" href="#rfc.section.7">
356      <link rel="Chapter" title="8 IANA Considerations" href="#rfc.section.8">
357      <link rel="Chapter" title="9 Acknowledgements" href="#rfc.section.9">
358      <link rel="Chapter" href="#rfc.section.10" title="10 References">
359      <link rel="Appendix" title="A Changes from the RFC 2616 Definition" href="#rfc.section.A">
360      <link rel="Appendix" title="B Differences Compared to RFC 2183" href="#rfc.section.B">
361      <link rel="Appendix" title="C Alternative Approaches to Internationalization" href="#rfc.section.C">
362      <link rel="Appendix" title="D Advice on Generating Content-Disposition Header Fields" href="#rfc.section.D">
363      <meta name="generator" content="http://greenbytes.de/tech/webdav/rfc2629.xslt, Revision 1.547, 2011-04-17 09:42:41, XSLT vendor: SAXON 8.9 from Saxonica http://www.saxonica.com/">
364      <link rel="schema.dct" href="http://purl.org/dc/terms/">
365      <meta name="dct.creator" content="Reschke, J. F.">
366      <meta name="dct.identifier" content="urn:ietf:id:draft-ietf-httpbis-content-disp-latest">
367      <meta name="dct.issued" scheme="ISO8601" content="2011-05-27">
368      <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.">
369      <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.">
370   </head>
371   <body>
372      <table class="header">
373         <tbody>
374            <tr>
375               <td class="left">HTTPbis Working Group</td>
376               <td class="right">J. Reschke</td>
377            </tr>
378            <tr>
379               <td class="left">Internet-Draft</td>
380               <td class="right">greenbytes</td>
381            </tr>
382            <tr>
383               <td class="left">Updates: <a href="http://tools.ietf.org/html/rfc2616">2616</a> (if approved)
384               </td>
385               <td class="right">May 27, 2011</td>
386            </tr>
387            <tr>
388               <td class="left">Intended status: Standards Track</td>
389               <td class="right"></td>
390            </tr>
391            <tr>
392               <td class="left">Expires: November 28, 2011</td>
393               <td class="right"></td>
394            </tr>
395         </tbody>
396      </table>
397      <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>
398      <h1 id="rfc.abstract"><a href="#rfc.abstract">Abstract</a></h1> 
399      <p>RFC 2616 defines the Content-Disposition response header field, but points out that it is not part of the HTTP/1.1 Standard.
400         This specification takes over the definition and registration of Content-Disposition, as used in HTTP, and clarifies internationalization
401         aspects.
402      </p> 
403      <h1><a id="rfc.status" href="#rfc.status">Status of This Memo</a></h1>
404      <p>This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.</p>
405      <p>Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute
406         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>.
407      </p>
408      <p>Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other
409         documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as “work
410         in progress”.
411      </p>
412      <p>This Internet-Draft will expire on November 28, 2011.</p>
413      <h1><a id="rfc.copyrightnotice" href="#rfc.copyrightnotice">Copyright Notice</a></h1>
414      <p>Copyright © 2011 IETF Trust and the persons identified as the document authors. All rights reserved.</p>
415      <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
416         and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License
417         text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified
418         BSD License.
419      </p>
420      <hr class="noprint">
421      <h1 class="np" id="rfc.toc"><a href="#rfc.toc">Table of Contents</a></h1>
422      <ul class="toc">
423         <li>1.&nbsp;&nbsp;&nbsp;<a href="#introduction">Introduction</a></li>
424         <li>2.&nbsp;&nbsp;&nbsp;<a href="#notational.conventions">Notational Conventions</a></li>
425         <li>3.&nbsp;&nbsp;&nbsp;<a href="#conformance.and.error.handling">Conformance and Error Handling</a></li>
426         <li>4.&nbsp;&nbsp;&nbsp;<a href="#header.field.definition">Header Field Definition</a><ul>
427               <li>4.1&nbsp;&nbsp;&nbsp;<a href="#rfc.section.4.1">Grammar</a></li>
428               <li>4.2&nbsp;&nbsp;&nbsp;<a href="#disposition.type">Disposition Type</a></li>
429               <li>4.3&nbsp;&nbsp;&nbsp;<a href="#disposition.parameter.filename">Disposition Parameter: 'Filename'</a></li>
430               <li>4.4&nbsp;&nbsp;&nbsp;<a href="#disposition.parameter.extensions">Disposition Parameter: Extensions</a></li>
431               <li>4.5&nbsp;&nbsp;&nbsp;<a href="#extensibility">Extensibility</a></li>
432            </ul>
433         </li>
434         <li>5.&nbsp;&nbsp;&nbsp;<a href="#examples">Examples</a></li>
435         <li>6.&nbsp;&nbsp;&nbsp;<a href="#i18n">Internationalization Considerations</a></li>
436         <li>7.&nbsp;&nbsp;&nbsp;<a href="#security.considerations">Security Considerations</a></li>
437         <li>8.&nbsp;&nbsp;&nbsp;<a href="#iana.considerations">IANA Considerations</a><ul>
438               <li>8.1&nbsp;&nbsp;&nbsp;<a href="#registry">Registry for Disposition Values and Parameters</a></li>
439               <li>8.2&nbsp;&nbsp;&nbsp;<a href="#header.field.registration">Header Field Registration</a></li>
440            </ul>
441         </li>
442         <li>9.&nbsp;&nbsp;&nbsp;<a href="#rfc.section.9">Acknowledgements</a></li>
443         <li>10.&nbsp;&nbsp;&nbsp;<a href="#rfc.references">References</a><ul>
444               <li>10.1&nbsp;&nbsp;&nbsp;<a href="#rfc.references.1">Normative References</a></li>
445               <li>10.2&nbsp;&nbsp;&nbsp;<a href="#rfc.references.2">Informative References</a></li>
446            </ul>
447         </li>
448         <li><a href="#rfc.authors">Author's Address</a></li>
449         <li>A.&nbsp;&nbsp;&nbsp;<a href="#changes.from.rfc2616">Changes from the RFC 2616 Definition</a></li>
450         <li>B.&nbsp;&nbsp;&nbsp;<a href="#diffs.compared.to.rfc2183">Differences Compared to RFC 2183</a></li>
451         <li>C.&nbsp;&nbsp;&nbsp;<a href="#alternatives">Alternative Approaches to Internationalization</a><ul>
452               <li>C.1&nbsp;&nbsp;&nbsp;<a href="#alternatives.rfc2047">RFC 2047 Encoding</a></li>
453               <li>C.2&nbsp;&nbsp;&nbsp;<a href="#alternatives.percent">Percent Encoding</a></li>
454               <li>C.3&nbsp;&nbsp;&nbsp;<a href="#alternatives.sniff">Encoding Sniffing</a></li>
455            </ul>
456         </li>
457         <li>D.&nbsp;&nbsp;&nbsp;<a href="#advice.generating">Advice on Generating Content-Disposition Header Fields</a></li>
458         <li><a href="#rfc.index">Index</a></li>
459      </ul>
460      <h1 id="rfc.section.1" class="np"><a href="#rfc.section.1">1.</a>&nbsp;<a id="introduction" href="#introduction">Introduction</a></h1>
461      <p id="rfc.section.1.p.1">RFC 2616 defines the Content-Disposition response header field (<a href="http://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="http://tools.ietf.org/html/rfc2616#section-15.5" id="rfc.xref.RFC2616.2">Section 15.5</a>):
462      </p>
463      <blockquote id="rfc.section.1.p.2" cite="http://tools.ietf.org/html/rfc2616#section-15.5"> 
464         <p>Content-Disposition is not part of the HTTP standard, but since it is widely implemented, we are documenting its use and risks
465            for implementers.
466         </p> 
467      </blockquote>
468      <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
469         testing with existing user agents (UAs), it fully defines a profile of the features defined in the Multipurpose Internet Mail
470         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.
471      </p>
472      <div class="note" id="rfc.section.1.p.4"> 
473         <p> <b>Note:</b> This document does not apply to Content-Disposition header fields appearing in payload bodies transmitted over HTTP, such
474            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>).
475         </p> 
476      </div>
477      <h1 id="rfc.section.2"><a href="#rfc.section.2">2.</a>&nbsp;<a id="notational.conventions" href="#notational.conventions">Notational Conventions</a></h1>
478      <p id="rfc.section.2.p.1">The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL"
479         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>.
480      </p>
481      <p id="rfc.section.2.p.2">This specification uses the augmented BNF (ABNF) notation defined in <a href="http://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).
482      </p>
483      <h1 id="rfc.section.3"><a href="#rfc.section.3">3.</a>&nbsp;<a id="conformance.and.error.handling" href="#conformance.and.error.handling">Conformance and Error Handling</a></h1>
484      <p id="rfc.section.3.p.1">This specification defines conformance criteria for both senders (usually, HTTP origin servers) and recipients (usually, HTTP
485         user agents) of the Content-Disposition header field. An implementation is considered conformant if it complies with all of
486         the requirements associated with its role.
487      </p>
488      <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
489         (<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.
490      </p>
491      <p id="rfc.section.3.p.3">Senders <em class="bcp14">MUST NOT</em> generate Content-Disposition header fields that are invalid.
492      </p>
493      <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,
494         the default handling of invalid fields is to ignore them.
495      </p>
496      <div id="rfc.iref.h.1"></div>
497      <div id="rfc.iref.c.1"></div>
498      <h1 id="rfc.section.4"><a href="#rfc.section.4">4.</a>&nbsp;<a id="header.field.definition" href="#header.field.definition">Header Field Definition</a></h1>
499      <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,
500         and also can be used to attach additional metadata, such as the filename to use when saving the response payload locally.
501      </p>
502      <h2 id="rfc.section.4.1"><a href="#rfc.section.4.1">4.1</a>&nbsp;Grammar
503      </h2>
504      <div id="rfc.figure.u.1"></div><pre class="inline">  content-disposition = "Content-Disposition" ":"
505                         disposition-type *( ";" disposition-parm )
506
507  disposition-type    = "inline" | "attachment" | disp-ext-type
508                      ; case-insensitive
509  disp-ext-type       = token
510
511  disposition-parm    = filename-parm | disp-ext-parm
512
513  filename-parm       = "filename" "=" value
514                      | "filename*" "=" ext-value
515 
516  disp-ext-parm       = token "=" value
517                      | ext-token "=" ext-value
518  ext-token           = &lt;the characters in token, followed by "*"&gt;
519</pre><div id="rfc.figure.u.2"></div> 
520      <p>Defined in <a href="#RFC2616" id="rfc.xref.RFC2616.4"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a>:
521      </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="http://tools.ietf.org/html/rfc2616#section-2.2">Section 2.2</a>&gt;
522  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="http://tools.ietf.org/html/rfc2616#section-2.2">Section 2.2</a>&gt;
523  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="http://tools.ietf.org/html/rfc2616#section-3.6">Section 3.6</a>&gt;
524                ; token | quoted-string
525             
526</pre><div id="rfc.figure.u.3"></div> 
527      <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>:
528      </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="http://tools.ietf.org/html/rfc5987#section-3.2">Section 3.2</a>&gt;
529</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>
530      <p id="rfc.section.4.1.p.5">Note that due to the rules for implied linear whitespace (<a href="http://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.
531      </p>
532      <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
533         use for filenames and is likely to be ignored by recipients.
534      </p>
535      <h2 id="rfc.section.4.2"><a href="#rfc.section.4.2">4.2</a>&nbsp;<a id="disposition.type" href="#disposition.type">Disposition Type</a></h2>
536      <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
537         to save the response locally, rather than process it normally (as per its media type).
538      </p>
539      <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
540         type "inline" is only useful when it is augmented with additional parameters, such as the filename (see below).
541      </p>
542      <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="http://tools.ietf.org/html/rfc2183#section-2.8">Section 2.8</a>).
543      </p>
544      <h2 id="rfc.section.4.3"><a href="#rfc.section.4.3">4.3</a>&nbsp;<a id="disposition.parameter.filename" href="#disposition.parameter.filename">Disposition Parameter: 'Filename'</a></h2>
545      <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
546         for storing the message payload.
547      </p>
548      <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
549         "attachment" disposition type), or later on (for instance, when the user decides to save the contents of the current page
550         being displayed).
551      </p>
552      <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>).
553      </p>
554      <p id="rfc.section.4.3.p.4">Many user agent implementations predating this specification do not understand the "filename*" parameter. Therefore, when
555         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
556         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).
557      </p>
558      <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
559         desired information. In particular:
560      </p>
561      <ul>
562         <li>
563            <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
564               the consequences of being able to overwrite well-known system locations (such as "/etc/passwd"). One strategy to achieve this
565               is to never trust folder name information in the filename parameter, for instance by stripping all but the last path segment
566               and only considering the actual filename (where 'path segment' are the components of the field value delimited by the path
567               separator characters "\" and "/").
568            </p>
569         </li>
570         <li>
571            <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
572               extension could introduce a privilege escalation when the saved file is later opened (consider ".exe"). Thus, recipients that
573               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.
574            </p>
575         </li>
576         <li>
577            <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
578               characters and leading and trailing whitespace.
579            </p>
580         </li>
581         <li>
582            <p>Other aspects recipients need to be aware of are names that have a special meaning in the file system or in shell commands,
583               such as "." and "..", "~", "|", and also device names. Recipients <em class="bcp14">SHOULD</em> ignore or substitute names like these.
584            </p>
585         </li>
586      </ul>
587      <div class="note" id="rfc.section.4.3.p.6"> 
588         <p> <b>Note:</b> Many user agents do not properly handle the escape character "\" when using the quoted-string form. Furthermore, some user
589            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.
590         </p> 
591      </div>
592      <h2 id="rfc.section.4.4"><a href="#rfc.section.4.4">4.4</a>&nbsp;<a id="disposition.parameter.extensions" href="#disposition.parameter.extensions">Disposition Parameter: Extensions</a></h2>
593      <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="http://tools.ietf.org/html/rfc2183#section-2.8">Section 2.8</a>).
594      </p>
595      <h2 id="rfc.section.4.5"><a href="#rfc.section.4.5">4.5</a>&nbsp;<a id="extensibility" href="#extensibility">Extensibility</a></h2>
596      <p id="rfc.section.4.5.p.1">Note that <a href="http://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
597         using Content-Disposition, such as MIME and HTTP. Therefore, not all registered values may make sense in the context of HTTP.
598      </p>
599      <h1 id="rfc.section.5"><a href="#rfc.section.5">5.</a>&nbsp;<a id="examples" href="#examples">Examples</a></h1>
600      <div id="rfc.figure.u.4"></div> 
601      <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
602</pre><div id="rfc.figure.u.5"></div> 
603      <p>Direct the UA to behave as if the Content-Disposition header field wasn't present, but to remember the filename "an example.html"
604         for a subsequent save operation:
605      </p>  <pre class="text">Content-Disposition: INLINE; FILENAME= "an example.html"
606</pre>  <p>Note: This uses the quoted-string form so that the space character can be included.</p> 
607      <div id="rfc.figure.u.6"></div> 
608      <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;
609                     filename*= UTF-8''<b>%e2%82%ac</b>%20rates
610</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.
611      </p> 
612      <div id="rfc.figure.u.7"></div> 
613      <p>This example is the same as above, but adding the "filename" parameter for compatibility with user agents not implementing
614         RFC 5987:
615      </p>  <pre class="text">Content-Disposition: attachment;
616                     filename="EURO rates";
617                     filename*=utf-8''<b>%e2%82%ac</b>%20rates
618</pre>  <p>Note: Those user agents that do not support the RFC 5987 encoding ignore "filename*" when it occurs after "filename".</p> 
619      <h1 id="rfc.section.6"><a href="#rfc.section.6">6.</a>&nbsp;<a id="i18n" href="#i18n">Internationalization Considerations</a></h1>
620      <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
621         in use.
622      </p>
623      <p id="rfc.section.6.p.2">Future parameters might also require internationalization, in which case the same encoding can be used.</p>
624      <h1 id="rfc.section.7"><a href="#rfc.section.7">7.</a>&nbsp;<a id="security.considerations" href="#security.considerations">Security Considerations</a></h1>
625      <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>.
626      </p>
627      <p id="rfc.section.7.p.2">Furthermore, implementers ought to be aware of the security considerations applying to HTTP (see <a href="http://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="http://tools.ietf.org/html/rfc5987#section-5" id="rfc.xref.RFC5987.7">Section 5</a>).
628      </p>
629      <h1 id="rfc.section.8"><a href="#rfc.section.8">8.</a>&nbsp;<a id="iana.considerations" href="#iana.considerations">IANA Considerations</a></h1>
630      <h2 id="rfc.section.8.1"><a href="#rfc.section.8.1">8.1</a>&nbsp;<a id="registry" href="#registry">Registry for Disposition Values and Parameters</a></h2>
631      <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
632         are defined in <a href="http://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>.
633      </p>
634      <h2 id="rfc.section.8.2"><a href="#rfc.section.8.2">8.2</a>&nbsp;<a id="header.field.registration" href="#header.field.registration">Header Field Registration</a></h2>
635      <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
636         (see <a href="#RFC3864" id="rfc.xref.RFC3864.1"><cite title="Registration Procedures for Message Header Fields">[RFC3864]</cite></a>).
637      </p>
638      <p id="rfc.section.8.2.p.2"> </p>
639      <dl>
640         <dt>Header field name:</dt>
641         <dd>Content-Disposition</dd>
642         <dt>Applicable protocol:</dt>
643         <dd>http</dd>
644         <dt>Status:</dt>
645         <dd>standard</dd>
646         <dt>Author/Change controller:</dt>
647         <dd>IETF</dd>
648         <dt>Specification document:</dt>
649         <dd>this specification (<a href="#header.field.definition" id="rfc.xref.header.field.definition.2" title="Header Field Definition">Section&nbsp;4</a>)
650         </dd>
651         <dt>Related information:</dt>
652         <dd>none</dd>
653      </dl>
654      <h1 id="rfc.section.9"><a href="#rfc.section.9">9.</a>&nbsp;Acknowledgements
655      </h1>
656      <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
657         Nordstrom, and Mark Nottingham for their valuable feedback.
658      </p>
659      <h1 id="rfc.references"><a id="rfc.section.10" href="#rfc.section.10">10.</a> References
660      </h1>
661      <h2 id="rfc.references.1"><a href="#rfc.section.10.1" id="rfc.section.10.1">10.1</a> Normative References
662      </h2>
663      <table>       
664         <tr>
665            <td class="reference"><b id="ISO-8859-1">[ISO-8859-1]</b></td>
666            <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>
667         </tr>
668         <tr>
669            <td class="reference"><b id="RFC2119">[RFC2119]</b></td>
670            <td class="top"><a href="mailto:sob@harvard.edu" title="Harvard University">Bradner, S.</a>, “<a href="http://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.
671            </td>
672         </tr>
673         <tr>
674            <td class="reference"><b id="RFC2616">[RFC2616]</b></td>
675            <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="http://tools.ietf.org/html/rfc2616">Hypertext Transfer Protocol -- HTTP/1.1</a>”, RFC&nbsp;2616, June&nbsp;1999.
676            </td>
677         </tr>
678         <tr>
679            <td class="reference"><b id="RFC5987">[RFC5987]</b></td>
680            <td class="top"><a href="mailto:julian.reschke@greenbytes.de" title="greenbytes GmbH">Reschke, J.</a>, “<a href="http://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.
681            </td>
682         </tr>
683      </table>
684      <h2 id="rfc.references.2"><a href="#rfc.section.10.2" id="rfc.section.10.2">10.2</a> Informative References
685      </h2>
686      <table>                 
687         <tr>
688            <td class="reference"><b id="RFC2046">[RFC2046]</b></td>
689            <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="http://tools.ietf.org/html/rfc2046">Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types</a>”, RFC&nbsp;2046, November&nbsp;1996.
690            </td>
691         </tr>
692         <tr>
693            <td class="reference"><b id="RFC2047">[RFC2047]</b></td>
694            <td class="top"><a href="mailto:moore@cs.utk.edu" title="University of Tennessee">Moore, K.</a>, “<a href="http://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.
695            </td>
696         </tr>
697         <tr>
698            <td class="reference"><b id="RFC2183">[RFC2183]</b></td>
699            <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="http://tools.ietf.org/html/rfc2183">Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field</a>”, RFC&nbsp;2183, August&nbsp;1997.
700            </td>
701         </tr>
702         <tr>
703            <td class="reference"><b id="RFC2231">[RFC2231]</b></td>
704            <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="http://tools.ietf.org/html/rfc2231">MIME Parameter Value and Encoded Word Extensions: Character Sets, Languages, and Continuations</a>”, RFC&nbsp;2231, November&nbsp;1997.
705            </td>
706         </tr>
707         <tr>
708            <td class="reference"><b id="RFC2388">[RFC2388]</b></td>
709            <td class="top"><a href="mailto:masinter@parc.xerox.com" title="Xerox Palo Alto Research Center">Masinter, L.</a>, “<a href="http://tools.ietf.org/html/rfc2388">Returning Values from Forms: multipart/form-data</a>”, RFC&nbsp;2388, August&nbsp;1998.
710            </td>
711         </tr>
712         <tr>
713            <td class="reference"><b id="RFC3864">[RFC3864]</b></td>
714            <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="http://tools.ietf.org/html/rfc3864">Registration Procedures for Message Header Fields</a>”, BCP&nbsp;90, RFC&nbsp;3864, September&nbsp;2004.
715            </td>
716         </tr>
717         <tr>
718            <td class="reference"><b id="RFC3986">[RFC3986]</b></td>
719            <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="http://tools.ietf.org/html/rfc3986">Uniform Resource Identifier (URI): Generic Syntax</a>”, STD&nbsp;66, RFC&nbsp;3986, January&nbsp;2005.
720            </td>
721         </tr>
722         <tr>
723            <td class="reference"><b id="US-ASCII">[US-ASCII]</b></td>
724            <td class="top">American National Standards Institute, “Coded Character Set -- 7-bit American Standard Code for Information Interchange”, ANSI&nbsp;X3.4, 1986.</td>
725         </tr>
726      </table>
727      <div class="avoidbreak">
728         <h1 id="rfc.authors"><a href="#rfc.authors">Author's Address</a></h1>
729         <address class="vcard"><span class="vcardline"><span class="fn">Julian F. Reschke</span><span class="n hidden"><span class="family-name">Reschke</span><span class="given-name">Julian F.</span></span></span><span class="org vcardline">greenbytes GmbH</span><span class="adr"><span class="street-address vcardline">Hafenweg 16</span><span class="vcardline"><span class="locality">Muenster</span>, <span class="region">NW</span>&nbsp;<span class="postal-code">48155</span></span><span class="country-name vcardline">Germany</span></span><span class="vcardline">Email: <a href="mailto:julian.reschke@greenbytes.de"><span class="email">julian.reschke@greenbytes.de</span></a></span><span class="vcardline">URI: <a href="http://greenbytes.de/tech/webdav/" class="url">http://greenbytes.de/tech/webdav/</a></span></address>
730      </div>
731      <h1 id="rfc.section.A" class="np"><a href="#rfc.section.A">A.</a>&nbsp;<a id="changes.from.rfc2616" href="#changes.from.rfc2616">Changes from the RFC 2616 Definition</a></h1>
732      <p id="rfc.section.A.p.1">Compared to <a href="http://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:
733      </p>
734      <ul>
735         <li>According to RFC 2616, the disposition type "attachment" only applies to content of type "application/octet-stream". This
736            restriction has been removed, because recipients in practice do not check the content type, and it also discourages properly
737            declaring the media type.
738         </li>
739         <li>RFC 2616 only allows "quoted-string" for the filename parameter. This would be an exceptional parameter syntax, and also doesn't
740            reflect actual use.
741         </li>
742         <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="http://tools.ietf.org/html/rfc2183#section-2.1">Section 2.1</a>) has been re-added with a suggestion for its processing.
743         </li>
744         <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>.
745         </li>
746      </ul>
747      <h1 id="rfc.section.B"><a href="#rfc.section.B">B.</a>&nbsp;<a id="diffs.compared.to.rfc2183" href="#diffs.compared.to.rfc2183">Differences Compared to RFC 2183</a></h1>
748      <p id="rfc.section.B.p.1"> <a href="http://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
749         majority of user agents do not implement these; thus, they have been omitted from this specification.
750      </p>
751      <h1 id="rfc.section.C"><a href="#rfc.section.C">C.</a>&nbsp;<a id="alternatives" href="#alternatives">Alternative Approaches to Internationalization</a></h1>
752      <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="http://tools.ietf.org/html/rfc2616#section-2.2">Section 2.2</a>). For the "filename" parameter, this of course is an unacceptable restriction.
753      </p>
754      <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
755         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>).
756      </p>
757      <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
758         to the RFC&nbsp;5987 encoding used in this specification.
759      </p>
760      <h2 id="rfc.section.C.1"><a href="#rfc.section.C.1">C.1</a>&nbsp;<a id="alternatives.rfc2047" href="#alternatives.rfc2047">RFC 2047 Encoding</a></h2>
761      <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
762         — see <a href="http://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>:
763      </p>
764      <blockquote id="rfc.section.C.1.p.2" cite="http://tools.ietf.org/html/rfc2047#section-5"> 
765         <p>An 'encoded-word' MUST NOT appear within a 'quoted-string'.</p> 
766         <p>...</p> 
767         <p>An 'encoded-word' MUST NOT be used in parameter of a MIME Content-Type or Content-Disposition field, or in any structured
768            field body except within a 'comment' or 'phrase'.
769         </p> 
770      </blockquote>
771      <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
772         confused by it.
773      </p>
774      <h2 id="rfc.section.C.2"><a href="#rfc.section.C.2">C.2</a>&nbsp;<a id="alternatives.percent" href="#alternatives.percent">Percent Encoding</a></h2>
775      <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="http://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
776         of the referring page, the user agent's locale, its configuration, and also the actual value of the parameter.
777      </p>
778      <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
779         to the user. For those user agents that do implement this, it is difficult to predict what character encoding they actually
780         expect.
781      </p>
782      <h2 id="rfc.section.C.3"><a href="#rfc.section.C.3">C.3</a>&nbsp;<a id="alternatives.sniff" href="#alternatives.sniff">Encoding Sniffing</a></h2>
783      <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
784         to be more likely to be the correct interpretation.
785      </p>
786      <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>
787      <h1 id="rfc.section.D"><a href="#rfc.section.D">D.</a>&nbsp;<a id="advice.generating" href="#advice.generating">Advice on Generating Content-Disposition Header Fields</a></h1>
788      <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
789         to:
790      </p>
791      <p id="rfc.section.D.p.2"> </p>
792      <ul>
793         <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.
794         </li>
795         <li>Use the 'token' form of the filename parameter only when it does not contain disallowed characters (e.g., spaces); in such
796            cases, the quoted-string form should be used.
797         </li>
798         <li>Avoid including the percent character followed by two hexadecimal characters (e.g., %A9) in the filename parameter, since
799            some existing implementations consider it to be an escape character, while others will pass it through unchanged.
800         </li>
801         <li>Avoid including the "\" character in the quoted-string form of the filename parameter, as escaping is not implemented by some
802            user agents, and "\" can be considered an illegal path character.
803         </li>
804         <li>Avoid using non-ASCII characters in the filename parameter. Although most existing implementations will decode them as ISO‑8859‑1,
805            some will apply heuristics to detect UTF-8, and thus might fail on certain names.
806         </li>
807         <li>Include a "filename*" parameter where the desired filename cannot be expressed faithfully using the "filename" form. Note
808            that legacy user agents will not process this, and will fall back to using the "filename" parameter's content.
809         </li>
810         <li>When a "filename*" parameter is sent, to also generate a "filename" parameter as a fallback for user agents that do not support
811            the "filename*" form, if possible. This can be done by substituting characters with US-ASCII sequences (e.g., Unicode character
812            point U+00E4 (LATIN SMALL LETTER A WITH DIARESIS) by "ae"). Note that this may not be possible in some locales.
813         </li>
814         <li>When a "filename" parameter is included as a fallback (as per above), "filename" should occur first, due to parsing problems
815            in some existing implementations.
816         </li>
817         <li>Use UTF-8 as the encoding of the "filename*" parameter, when present, because at least one existing implementation only implements
818            that encoding.
819         </li>
820      </ul>
821      <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
822         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.
823      </p>
824      <h1 id="rfc.index"><a href="#rfc.index">Index</a></h1>
825      <p class="noprint"><a href="#rfc.index.C">C</a> <a href="#rfc.index.H">H</a> <a href="#rfc.index.I">I</a> <a href="#rfc.index.R">R</a> <a href="#rfc.index.U">U</a> 
826      </p>
827      <div class="print2col">
828         <ul class="ind">
829            <li><a id="rfc.index.C" href="#rfc.index.C"><b>C</b></a><ul>
830                  <li>Content-Disposition header field&nbsp;&nbsp;<a href="#rfc.xref.header.field.definition.1">3</a>, <a href="#rfc.iref.c.1"><b>4</b></a>, <a href="#rfc.xref.header.field.definition.2">8.2</a></li>
831               </ul>
832            </li>
833            <li><a id="rfc.index.H" href="#rfc.index.H"><b>H</b></a><ul>
834                  <li>Header Fields&nbsp;&nbsp;
835                     <ul>
836                        <li>Content-Disposition&nbsp;&nbsp;<a href="#rfc.xref.header.field.definition.1">3</a>, <a href="#rfc.iref.h.1"><b>4</b></a>, <a href="#rfc.xref.header.field.definition.2">8.2</a></li>
837                     </ul>
838                  </li>
839               </ul>
840            </li>
841            <li><a id="rfc.index.I" href="#rfc.index.I"><b>I</b></a><ul>
842                  <li><em>ISO-8859-1</em>&nbsp;&nbsp;<a href="#rfc.xref.ISO-8859-1.1">4.3</a>, <a href="#ISO-8859-1"><b>10.1</b></a>, <a href="#rfc.xref.ISO-8859-1.2">C</a></li>
843               </ul>
844            </li>
845            <li><a id="rfc.index.R" href="#rfc.index.R"><b>R</b></a><ul>
846                  <li><em>RFC2046</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC2046.1">4.3</a>, <a href="#RFC2046"><b>10.2</b></a></li>
847                  <li><em>RFC2047</em>&nbsp;&nbsp;<a href="#RFC2047"><b>10.2</b></a>, <a href="#rfc.xref.RFC2047.1">C.1</a><ul>
848                        <li><em>Section 5</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC2047.1">C.1</a></li>
849                     </ul>
850                  </li>
851                  <li><em>RFC2119</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC2119.1">2</a>, <a href="#RFC2119"><b>10.1</b></a></li>
852                  <li><em>RFC2183</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC2183.1">1</a>, <a href="#rfc.xref.RFC2183.2">4.2</a>, <a href="#rfc.xref.RFC2183.3">4.4</a>, <a href="#rfc.xref.RFC2183.4">4.5</a>, <a href="#rfc.xref.RFC2183.5">8.1</a>, <a href="#RFC2183"><b>10.2</b></a>, <a href="#rfc.xref.RFC2183.6">A</a>, <a href="#rfc.xref.RFC2183.7">B</a><ul>
853                        <li><em>Section 2</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC2183.7">B</a></li>
854                        <li><em>Section 2.1</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC2183.6">A</a></li>
855                        <li><em>Section 2.8</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC2183.2">4.2</a>, <a href="#rfc.xref.RFC2183.3">4.4</a></li>
856                        <li><em>Section 9</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC2183.4">4.5</a>, <a href="#rfc.xref.RFC2183.5">8.1</a></li>
857                     </ul>
858                  </li>
859                  <li><em>RFC2231</em>&nbsp;&nbsp;<a href="#RFC2231"><b>10.2</b></a>, <a href="#rfc.xref.RFC2231.1">C</a></li>
860                  <li><em>RFC2388</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC2388.1">1</a>, <a href="#RFC2388"><b>10.2</b></a></li>
861                  <li><em>RFC2616</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC2616.1">1</a>, <a href="#rfc.xref.RFC2616.2">1</a>, <a href="#rfc.xref.RFC2616.3">2</a>, <a href="#rfc.xref.RFC2616.4">4.1</a>, <a href="#rfc.xref.RFC2616.5">4.1</a>, <a href="#rfc.xref.RFC2616.6">4.1</a>, <a href="#rfc.xref.RFC2616.7">4.1</a>, <a href="#rfc.xref.RFC2616.8">4.1</a>, <a href="#rfc.xref.RFC2616.9">7</a>, <a href="#RFC2616"><b>10.1</b></a>, <a href="#rfc.xref.RFC2616.10">A</a>, <a href="#rfc.xref.RFC2616.11">C</a><ul>
862                        <li><em>Section 2.1</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC2616.3">2</a>, <a href="#rfc.xref.RFC2616.8">4.1</a></li>
863                        <li><em>Section 2.2</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC2616.5">4.1</a>, <a href="#rfc.xref.RFC2616.6">4.1</a>, <a href="#rfc.xref.RFC2616.11">C</a></li>
864                        <li><em>Section 3.6</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC2616.7">4.1</a></li>
865                        <li><em>Section 15.5</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC2616.2">1</a></li>
866                        <li><em>Section 15</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC2616.9">7</a></li>
867                        <li><em>Section 19.5.1</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC2616.1">1</a>, <a href="#rfc.xref.RFC2616.10">A</a></li>
868                     </ul>
869                  </li>
870                  <li><em>RFC3864</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC3864.1">8.2</a>, <a href="#RFC3864"><b>10.2</b></a></li>
871                  <li><em>RFC3986</em>&nbsp;&nbsp;<a href="#RFC3986"><b>10.2</b></a>, <a href="#rfc.xref.RFC3986.1">C.2</a><ul>
872                        <li><em>Section 2.1</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC3986.1">C.2</a></li>
873                     </ul>
874                  </li>
875                  <li><em>RFC5987</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC5987.1">4.1</a>, <a href="#rfc.xref.RFC5987.2">4.1</a>, <a href="#rfc.xref.RFC5987.3">4.3</a>, <a href="#rfc.xref.RFC5987.4">5</a>, <a href="#rfc.xref.RFC5987.5">6</a>, <a href="#rfc.xref.RFC5987.6">7</a>, <a href="#rfc.xref.RFC5987.7">7</a>, <a href="#RFC5987"><b>10.1</b></a>, <a href="#rfc.xref.RFC5987.8">A</a>, <a href="#rfc.xref.RFC5987.9">C</a><ul>
876                        <li><em>Section 3.2</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC5987.2">4.1</a></li>
877                        <li><em>Section 5</em>&nbsp;&nbsp;<a href="#rfc.xref.RFC5987.7">7</a></li>
878                     </ul>
879                  </li>
880               </ul>
881            </li>
882            <li><a id="rfc.index.U" href="#rfc.index.U"><b>U</b></a><ul>
883                  <li><em>US-ASCII</em>&nbsp;&nbsp;<a href="#US-ASCII"><b>10.2</b></a>, <a href="#rfc.xref.US-ASCII.1">D</a></li>
884               </ul>
885            </li>
886         </ul>
887      </div>
888   </body>
889</html>
Note: See TracBrowser for help on using the repository browser.