[html5] r7057 - [giow] (0) Introduce extensions in accept=''. Fixing https://www.w3.org/Bugs/Pub [...]

whatwg at whatwg.org whatwg at whatwg.org
Wed Apr 18 16:22:42 PDT 2012


Author: ianh
Date: 2012-04-18 16:22:41 -0700 (Wed, 18 Apr 2012)
New Revision: 7057

Modified:
   complete.html
   index
   source
Log:
[giow] (0) Introduce extensions in accept=''.
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=11482
Affected topics: HTML

Modified: complete.html
===================================================================
--- complete.html	2012-04-18 06:57:51 UTC (rev 7056)
+++ complete.html	2012-04-18 23:22:41 UTC (rev 7057)
@@ -48451,6 +48451,10 @@
 
    <dd>Indicates that files of the specified type are accepted.</dd>
 
+   <dt>A string whose first character is a U+002E FULL STOP character (.)</dt>
+
+   <dd>Indicates that files with the specified file extension are accepted.</dd>
+
   </dl><p>The tokens must not be <a href=#ascii-case-insensitive>ASCII case-insensitive</a>
   matches for any of the other tokens (i.e. duplicates are not
   allowed). <span class=impl>To obtain the list of tokens from the
@@ -48471,6 +48475,44 @@
 
   </div>
 
+  <p class=note>Authors are encouraged to specify both any MIME
+  types and any corresponding extensions when looking for data in a
+  specific format.</p>
+
+  <div class=example>
+
+   <p>For example, consider an application that converts Microsoft
+   Word documents to Open Document Format files. Since Microsoft Word
+   documents are described with a wide variety of MIME types and
+   extensions, the site can list several, as follows:</p>
+
+   <pre><input type="file" accept=".doc .docx .xml application/msword application/vnd.openxmlformats-officedocument.wordprocessingml.document"></pre>
+
+   <p>On platforms that only use file extensions to describe file
+   types, the extensions listed here can be used to filter the allowed
+   documents, while the MIME types can be used with the system's type
+   registration table (mapping MIME types to extensions used by the
+   system), if any, to determine any other extensions to allow.
+   Similarly, on a system that does not have file names or extensions
+   but labels documents with MIME types internally, the MIME types can
+   be used to pick the allowed files, while the extensions can be used
+   if the system has an extension registration table that maps known
+   extensions to MIME types used by the system.</p>
+
+  </div>
+
+  <p class=warning>Extensions tend to be ambiguous (e.g. there are
+  an untold number of formats that use the "<code title="">.dat</code>" extension, and users can typically quite
+  easily rename their files to have a "<code title="">.doc</code>"
+  extension even if they are not Microsoft Word documents), and MIME
+  types tend to be unreliable (e.g. many formats have no formally
+  registered types, and many formats are in practice labeled using a
+  number of different MIME types). Authors are reminded that, as
+  usual, data received from a client should be treated with caution,
+  as it may not be in an expected format even if the user is not
+  hostile and the user agent fully obeyed the <code title=attr-input-accept><a href=#attr-input-accept>accept</a></code> attribute's
+  requirements.</p>
+
   <div class=example id=fakepath-srsly>
 
    <p>For historical reasons, the <code title=dom-input-value><a href=#dom-input-value>value</a></code> IDL attribute prefixes the

Modified: index
===================================================================
--- index	2012-04-18 06:57:51 UTC (rev 7056)
+++ index	2012-04-18 23:22:41 UTC (rev 7057)
@@ -48451,6 +48451,10 @@
 
    <dd>Indicates that files of the specified type are accepted.</dd>
 
+   <dt>A string whose first character is a U+002E FULL STOP character (.)</dt>
+
+   <dd>Indicates that files with the specified file extension are accepted.</dd>
+
   </dl><p>The tokens must not be <a href=#ascii-case-insensitive>ASCII case-insensitive</a>
   matches for any of the other tokens (i.e. duplicates are not
   allowed). <span class=impl>To obtain the list of tokens from the
@@ -48471,6 +48475,44 @@
 
   </div>
 
+  <p class=note>Authors are encouraged to specify both any MIME
+  types and any corresponding extensions when looking for data in a
+  specific format.</p>
+
+  <div class=example>
+
+   <p>For example, consider an application that converts Microsoft
+   Word documents to Open Document Format files. Since Microsoft Word
+   documents are described with a wide variety of MIME types and
+   extensions, the site can list several, as follows:</p>
+
+   <pre><input type="file" accept=".doc .docx .xml application/msword application/vnd.openxmlformats-officedocument.wordprocessingml.document"></pre>
+
+   <p>On platforms that only use file extensions to describe file
+   types, the extensions listed here can be used to filter the allowed
+   documents, while the MIME types can be used with the system's type
+   registration table (mapping MIME types to extensions used by the
+   system), if any, to determine any other extensions to allow.
+   Similarly, on a system that does not have file names or extensions
+   but labels documents with MIME types internally, the MIME types can
+   be used to pick the allowed files, while the extensions can be used
+   if the system has an extension registration table that maps known
+   extensions to MIME types used by the system.</p>
+
+  </div>
+
+  <p class=warning>Extensions tend to be ambiguous (e.g. there are
+  an untold number of formats that use the "<code title="">.dat</code>" extension, and users can typically quite
+  easily rename their files to have a "<code title="">.doc</code>"
+  extension even if they are not Microsoft Word documents), and MIME
+  types tend to be unreliable (e.g. many formats have no formally
+  registered types, and many formats are in practice labeled using a
+  number of different MIME types). Authors are reminded that, as
+  usual, data received from a client should be treated with caution,
+  as it may not be in an expected format even if the user is not
+  hostile and the user agent fully obeyed the <code title=attr-input-accept><a href=#attr-input-accept>accept</a></code> attribute's
+  requirements.</p>
+
   <div class=example id=fakepath-srsly>
 
    <p>For historical reasons, the <code title=dom-input-value><a href=#dom-input-value>value</a></code> IDL attribute prefixes the

Modified: source
===================================================================
--- source	2012-04-18 06:57:51 UTC (rev 7056)
+++ source	2012-04-18 23:22:41 UTC (rev 7057)
@@ -56414,6 +56414,10 @@
 
    <dd>Indicates that files of the specified type are accepted.</dd>
 
+   <dt>A string whose first character is a U+002E FULL STOP character (.)</dt>
+
+   <dd>Indicates that files with the specified file extension are accepted.</dd>
+
   </dl>
 
   <p>The tokens must not be <span>ASCII case-insensitive</span>
@@ -56437,6 +56441,46 @@
 
   </div>
 
+  <p class="note">Authors are encouraged to specify both any MIME
+  types and any corresponding extensions when looking for data in a
+  specific format.</p>
+
+  <div class="example">
+
+   <p>For example, consider an application that converts Microsoft
+   Word documents to Open Document Format files. Since Microsoft Word
+   documents are described with a wide variety of MIME types and
+   extensions, the site can list several, as follows:</p>
+
+   <pre><input type="file" accept=".doc .docx .xml application/msword application/vnd.openxmlformats-officedocument.wordprocessingml.document"></pre>
+
+   <p>On platforms that only use file extensions to describe file
+   types, the extensions listed here can be used to filter the allowed
+   documents, while the MIME types can be used with the system's type
+   registration table (mapping MIME types to extensions used by the
+   system), if any, to determine any other extensions to allow.
+   Similarly, on a system that does not have file names or extensions
+   but labels documents with MIME types internally, the MIME types can
+   be used to pick the allowed files, while the extensions can be used
+   if the system has an extension registration table that maps known
+   extensions to MIME types used by the system.</p>
+
+  </div>
+
+  <p class="warning">Extensions tend to be ambiguous (e.g. there are
+  an untold number of formats that use the "<code
+  title="">.dat</code>" extension, and users can typically quite
+  easily rename their files to have a "<code title="">.doc</code>"
+  extension even if they are not Microsoft Word documents), and MIME
+  types tend to be unreliable (e.g. many formats have no formally
+  registered types, and many formats are in practice labeled using a
+  number of different MIME types). Authors are reminded that, as
+  usual, data received from a client should be treated with caution,
+  as it may not be in an expected format even if the user is not
+  hostile and the user agent fully obeyed the <code
+  title="attr-input-accept">accept</code> attribute's
+  requirements.</p>
+
   <div class="example" id="fakepath-srsly">
 
    <p>For historical reasons, the <code




More information about the Commit-Watchers mailing list