<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>11482</bug_id>
          
          <creation_ts>2010-12-06 18:32:18 +0000</creation_ts>
          <short_desc>WF2: Change accept=&quot;&quot; to accept file extensions as well as MIME types (maybe based on whether they start with a period)</short_desc>
          <delta_ts>2012-04-18 23:23:00 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>LC1 HTML5 spec</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#file-upload-state</bug_file_loc>
          <status_whiteboard>awaiting implementation feedback</status_whiteboard>
          <keywords>WGDecision</keywords>
          <priority>P3</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>15607</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>annevk</cc>
    
    <cc>bugzilla.119x</cc>
    
    <cc>hsivonen</cc>
    
    <cc>ian</cc>
    
    <cc>jackalmage</cc>
    
    <cc>julian.reschke</cc>
    
    <cc>mike</cc>
    
    <cc>mounir</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>rubys</cc>
    
    <cc>sharco</cc>
    
    <cc>singer</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>43092</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2010-12-06 18:32:18 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/number-state.html
Section: http://www.whatwg.org/specs/web-apps/current-work/#file-upload-state

Comment:
Requiring MIME types like
application/vnd.openxmlformats-officedocument.wordprocessingml.document in
order to allow a .docx file to be uploaded is far too technical for the
layman.  On the other hand it is equally impractical for web developers to
keep an accurate mapping of extension to MIME type within our code because
those types change and new types are added with some frequency.  As a matter
of practicality file extensions should be acceptable tokens for the &quot;accept&quot;
attribute in order to make it useful.

Posted from: 208.73.113.6</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>43093</commentid>
    <comment_count>1</comment_count>
    <who name="">bugzilla.119x</who>
    <bug_when>2010-12-06 18:33:54 +0000</bug_when>
    <thetext>see http://www.w3.org/Bugs/Public/show_bug.cgi?id=11481 for a bit more detail...  (marking that bug as a duplicate)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>43095</commentid>
    <comment_count>2</comment_count>
    <who name="">bugzilla.119x</who>
    <bug_when>2010-12-06 18:34:13 +0000</bug_when>
    <thetext>*** Bug 11481 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>43149</commentid>
    <comment_count>3</comment_count>
    <who name="David Singer">singer</who>
    <bug_when>2010-12-07 17:25:29 +0000</bug_when>
    <thetext>MIMe types may be awkward, but at least they are documented.  File extensions are, as far as I know, completely unregistered.  There are some web sites with incomplete maps (NIST had one, and there is fileext) and a number of known conflicts (the same extension used for two meanings).  I fear that this would not result in good interoperability.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44086</commentid>
    <comment_count>4</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2011-01-11 01:50:23 +0000</bug_when>
    <thetext>I don&apos;t see what compat problems could come from this.  Using a file extension in @accept would just let browsers filter the file upload dialogs by file extension, a functionality already present in major OSes and used by many programs to good effect.

Browsers don&apos;t need to care about what the extensions represent or what type of files the author is &quot;really&quot; talking about.  They just need to know that the author wants files with a particular extension.  That&apos;s easy information to get from the OS, and useful for the user.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44130</commentid>
    <comment_count>5</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2011-01-11 09:30:33 +0000</bug_when>
    <thetext>I think before extending this further we should first have solid implementations of accept=&quot;&quot; as it stands today. The use case for &quot;image/*&quot; for instance is really big but there is not many user agents that do something clever with it.

(This is also the reason file extensions are not that nice as you cannot do something clever with them. You can just filter. If you have the media type you could offer a shortcut to Word for instance. If you just have the file extension that becomes a bit more dodgy.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45679</commentid>
    <comment_count>6</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-02-16 09:22:28 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Rejected
Change Description: no spec change
Rationale: I&apos;m rejecting this mostly on the grounds Anne laid out in comment 5: accept=&quot;&quot; isn&apos;t even remotely well implemented as it is, so adding yet more features to it already seems a bit dodgy. In practice I expect people will just pick the file regardless of the extension or type, anyway, so the feature is arguable not that useful in the first place.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53355</commentid>
    <comment_count>7</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2011-08-04 05:13:04 +0000</bug_when>
    <thetext>mass-move component to LC1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58208</commentid>
    <comment_count>8</comment_count>
    <who name="Sharon [MSFT]">sharco</who>
    <bug_when>2011-10-14 00:14:51 +0000</bug_when>
    <thetext>Having implemented support for the accept attribute in IE10 we are now getting feedback from web developers that they would like to be able to be able to supply file extensions in the accept attribute. We believe this would be a useful addition to the accept attribute because in many operating systems including Windows, files can</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58212</commentid>
    <comment_count>9</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2011-10-14 01:25:27 +0000</bug_when>
    <thetext>Another problem is that file extensions are not platform-independent. In particular, the web platform does not really have knowledge of them (except in one or two places for legacy reasons).

Also, comment 5 is not addressed yet.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58225</commentid>
    <comment_count>10</comment_count>
    <who name="Henri Sivonen">hsivonen</who>
    <bug_when>2011-10-14 12:58:56 +0000</bug_when>
    <thetext>(In reply to comment #9)
&gt; Another problem is that file extensions are not platform-independent.

Now that Mac OS Classic is long gone, file name extensions are used on pretty much all platforms that expose files to the user. Also, collision avoidance in this space has worked remarkably well without IANA formalities.

&gt; In particular, the web platform does not really have knowledge of them

That could be treated as a bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58262</commentid>
    <comment_count>11</comment_count>
    <who name="Sharon [MSFT]">sharco</who>
    <bug_when>2011-10-14 22:51:38 +0000</bug_when>
    <thetext>In reply to comment #5 </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58382</commentid>
    <comment_count>12</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-10-18 20:33:16 +0000</bug_when>
    <thetext>(In reply to comment #11)
&gt; Here is one specific example. A web developer who wants the user to upload a
&gt; .csv file. The mime type for csv files is �application/vnd.ms-excel�. 

Actually it&apos;s text/csv. See: http://tools.ietf.org/html/rfc4180</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59514</commentid>
    <comment_count>13</comment_count>
    <who name="Sharon [MSFT]">sharco</who>
    <bug_when>2011-11-02 19:25:31 +0000</bug_when>
    <thetext>(In reply to comment #12)
text/csv isn&apos;t a registered mime type on either of my two machines.  Putting accept=&quot;text/csv&quot; results in a *.* filter in both IE and Chrome. It&apos;s only a single data point but I think it still shows that using mime type in the accept parameter is inexact. Browsers can attempt to lookup the file extension the developer wanted, but it won&apos;t work in all cases.  

If the developer could specify exactly what file extensions they wanted, we could eliminate the inexactness of the mime lookup.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59981</commentid>
    <comment_count>14</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-11-11 23:08:19 +0000</bug_when>
    <thetext>File extensions aren&apos;t any more exact than MIME types, IMHO. What&apos;s the format of a .doc file? There&apos;s dozens of software packages that use that extension. Even Word uses that same extension for multiple different formats.

But I&apos;ve never objected to this proposal per se; the reason this bug is not yet fixed is described in comment 5 and comment 6. The feature hasn&apos;t been widely implemented in the first place, it doesn&apos;t make sense to extend it already, when it&apos;s not clear it&apos;s even a valid feature (we don&apos;t have significant implementation experience with the MIME type version of this). CSV files are in fact a good example, regardless of whether the author uses text/csv or .csv: if a user goes to a Web site and downloads a CSV file, it has as good a chance of having the .txt or even .html extension, or indeed .php or .cgi, as it does .csv. Why would it help the user to set a type or an extension?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60110</commentid>
    <comment_count>15</comment_count>
    <who name="Henri Sivonen">hsivonen</who>
    <bug_when>2011-11-17 14:48:33 +0000</bug_when>
    <thetext>(In reply to comment #14)
&gt; File extensions aren&apos;t any more exact than MIME types, IMHO. What&apos;s the format
&gt; of a .doc file? There&apos;s dozens of software packages that use that extension.
&gt; Even Word uses that same extension for multiple different formats.

Even if you can find an example of non-Word files being named .doc, it doesn&apos;t make MIME types and and file name extensions equally (in)exact. Chances are that for upload, a filter based on file name extension would still have a better success rate than MIME types, because the current systems in use use file name extensions, so a browser-provided always-incomplete mapping layer isn&apos;t needed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60925</commentid>
    <comment_count>16</comment_count>
    <who name="Henri Sivonen">hsivonen</who>
    <bug_when>2011-12-05 08:48:48 +0000</bug_when>
    <thetext>&gt; Awaiting implementation experience of existing accept=&quot;&quot; feature

Why doesn&apos;t comment 11 count as sufficient experience? Why should anyone implement the feature as specced if they already see the specced feature doesn&apos;t do what&apos;s actually needed?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61112</commentid>
    <comment_count>17</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-12-07 20:14:05 +0000</bug_when>
    <thetext>Henri: Based on comment 11, I would be forced to conclude that providing a MIME type at all is a waste of time, and hat we should remove that feature and replace it with one that takes extensions, to see if that works instead. That seems highly unlikely to be the actual situation (I would guess that since operating systems these days actually have applications register MIME types and extensions alike, they would often both work, especially for more standard types like images), hence my desire to get more implementation experience.

My guess is that data will show that both MIME types and extensions have their place, but both should be purely advisory, never _preventing_ users from uploading their files.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62705</commentid>
    <comment_count>18</comment_count>
    <who name="Sharon [MSFT]">sharco</who>
    <bug_when>2012-01-14 00:45:44 +0000</bug_when>
    <thetext>I am nominating this bug for escalation. The proposal is pretty small and fits well with the intention of the accept attribute, also the main objection seems to be lack of implementation experience, something that I believe is pretty debatable.  

Proposed title: Accept attribute should allow file extensions in addition to the current allowed values

Description: The spec states: “The accept attribute may be specified to provide user agents with a hint of what file types will be accepted.” The options currently allowed in the accept attribute are mime types and the special tokens “audio/*”, “image/*”, “video/*”.  Allowing file extensions to be a token would help many developers and fits in exactly with the purpose of the accept attribute.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62710</commentid>
    <comment_count>19</comment_count>
    <who name="Julian Reschke">julian.reschke</who>
    <bug_when>2012-01-14 09:41:18 +0000</bug_when>
    <thetext>(In reply to comment #18)
&gt; I am nominating this bug for escalation. The proposal is pretty small and fits
&gt; well with the intention of the accept attribute, also the main objection seems
&gt; to be lack of implementation experience, something that I believe is pretty
&gt; debatable.  
&gt; ...

This bug is in state &quot;NEW&quot;; thus, it&apos;s not supposed to be escalated to a tracker issue. Asking chairs for advice how to proceed...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62713</commentid>
    <comment_count>20</comment_count>
    <who name="Sam Ruby">rubys</who>
    <bug_when>2012-01-14 12:33:17 +0000</bug_when>
    <thetext>(In reply to comment #19)
&gt; (In reply to comment #18)
&gt; &gt; I am nominating this bug for escalation. The proposal is pretty small and fits
&gt; &gt; well with the intention of the accept attribute, also the main objection seems
&gt; &gt; to be lack of implementation experience, something that I believe is pretty
&gt; &gt; debatable.  
&gt; &gt; ...
&gt; 
&gt; This bug is in state &quot;NEW&quot;; thus, it&apos;s not supposed to be escalated to a
&gt; tracker issue. Asking chairs for advice how to proceed...

Julian: see:

http://lists.w3.org/Archives/Public/public-html/2011Jun/0315.html

In particular, look at the entries for Aug 3, 2011 and December 31, 2011, and specifically, the consequences for missing that latter date.

Also look at the entry for Jan 14, 2012.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62714</commentid>
    <comment_count>21</comment_count>
    <who name="Julian Reschke">julian.reschke</who>
    <bug_when>2012-01-14 12:44:18 +0000</bug_when>
    <thetext>(In reply to comment #20)
&gt; Julian: see:

Thx.

&gt; http://lists.w3.org/Archives/Public/public-html/2011Jun/0315.html
&gt; 
&gt; In particular, look at the entries for Aug 3, 2011 and December 31, 2011, and
&gt; specifically, the consequences for missing that latter date.

Dec 31: &quot;Consequences of missing this date: bugs still open past this date can be escalated to Tracker Issues immediately if the originator so chooses.&quot;

So I read this that this issue can be escalated even through it&apos;s in OPEN state.

&gt; Also look at the entry for Jan 14, 2012.

Aware of that :-).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62715</commentid>
    <comment_count>22</comment_count>
    <who name="Julian Reschke">julian.reschke</who>
    <bug_when>2012-01-14 12:48:07 +0000</bug_when>
    <thetext>Raised as &lt;https://www.w3.org/html/wg/tracker/issues/197&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62833</commentid>
    <comment_count>23</comment_count>
    <who name="Sam Ruby">rubys</who>
    <bug_when>2012-01-18 01:55:56 +0000</bug_when>
    <thetext>Changed status per: http://lists.w3.org/Archives/Public/public-html/2012Jan/0087.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64468</commentid>
    <comment_count>24</comment_count>
    <who name="Sam Ruby">rubys</who>
    <bug_when>2012-02-23 01:36:28 +0000</bug_when>
    <thetext>(In reply to comment #11)
&gt; In reply to comment #5 

Original content of comment #11:

http://lists.w3.org/Archives/Public/public-html-bugzilla/2011Oct/0513.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64475</commentid>
    <comment_count>25</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2012-02-23 05:23:12 +0000</bug_when>
    <thetext>Comment 11 got lost somehow. No idea how, but I have asked the systems  team to check on it.

Here for the record is the original comment:

--- Comment #11 from Sharon [MSFT] &lt;sharco@microsoft.com&gt; 2011-10-14 22:51:38 UTC ---
In reply to comment #5 – I agree that there are some interesting use cases for
image/*, video/* and audio/* strings.  I’m not proposing removing those,
however, we believe there are also good use cases for file extensions which are
not covered by the existing options.  

Here is one specific example. A web developer who wants the user to upload a
.csv file. The mime type for csv files is “application/vnd.ms-excel”.  If you
use this mime type in Chrome today you get only .xls file and in IE10 today you
get .csv, .slk, .xla, .xld, .xlk, .xll, .xlm, .xls, .xlt and .xlw.  Neither of
these are really what the developer wanted.  

In reply to comment #9 – Section 12 of the spec already has some mentions of
file extensions.  Also the purpose of the accept attribute is to give the
browser hints for how to request files from the OS.  This seems like a logical
place to use an OS concept even if it’s not known to the web platform.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66335</commentid>
    <comment_count>26</comment_count>
    <who name="Sam Ruby">rubys</who>
    <bug_when>2012-04-02 16:25:12 +0000</bug_when>
    <thetext>Decision:

  http://lists.w3.org/Archives/Public/public-html/2012Mar/0788.html

Change Proposal:

  http://www.w3.org/wiki/Accept_Attribute_with_File_extensions</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66830</commentid>
    <comment_count>27</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-04-18 23:22:39 +0000</bug_when>
    <thetext>Done, though I used slightly different text since the text in the CP didn&apos;t make much sense (e.g. it introduced a conformance criteria that depended on the concept of a &quot;valid file extension&quot;, without saying what that was; required user agents to treat file extensions &quot;as file extensions&quot;, without saying what that meant; and require user agents to treat an invalid string &quot;as a MIME type&quot;, without saying how to do so), and added a few notes and examples for clarity.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66831</commentid>
    <comment_count>28</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-04-18 23:23:00 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r7057.
Check-in comment: Introduce extensions in accept=&apos;&apos;.
http://html5.org/tools/web-apps-tracker?from=7056&amp;to=7057</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>