37

Anyone know how to get accept working in Edge?

<input type="file" accept=".csv">

Works fine in Chrome 44, Firefox 39, IE 11, Opera 31.

Also tried

<input type="file" accept=".csv,text/csv">

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
SavageCore
  • 478
  • 1
  • 6
  • 10
  • In what way is it not working? It is functioning fine for me – Patrick Aug 08 '15 at 05:23
  • Really? Odd. My [file choices](http://i.imgur.com/sPuWu1P.png) when `accept=".csv"` in MS Edge only. – SavageCore Aug 12 '15 at 10:46
  • 1
    Does anyone know of a workaround? I think at this point (3 years after alerting MS about the issue) we can assume they will not fix it. But many people still need a workaround. – Noah Gary Apr 04 '19 at 15:48

2 Answers2

27

"accept" attributes are definitely not supported in Microsoft Edge at this point. I confirmed your behavior as "no go" in edge, but showing up in IE via the [...] thing in the upper right of Edge.

The Edge status shows it as "Under Consideration" with just 198 votes at https://wpdev.uservoice.com/forums/257854-microsoft-edge-developer/suggestions/13661175-full-spec-support-for-accept-in-input-type-file .

If you're interested in implementation of the HTTP Client Hints (aka "accept") on Edge be sure and vote it up at the URL above.

Joe Healy
  • 5,769
  • 3
  • 38
  • 56
  • 1
    Hi, Any update on this? I'm trying with accept="video/*" OR accept="pdf/*" and it still shows as "All Files" and not filtering. Under latest stable version from Microsoft (20.10240.16384.0 ) – normalUser Oct 13 '15 at 07:13
  • still viewed as 'under consideration', no timeline. vote it up? – Joe Healy Oct 13 '15 at 17:43
  • 10
    I might be wrong but I don't think HTTP client hints is the feature that the question is referring to. I think it's this feature http://caniuse.com/#feat=input-file-accept which Edge supposedly supports. I can reproduce the issue as well and it should probably be reported as a bug here https://connect.microsoft.com/IE/Feedback – mparizeau Oct 14 '15 at 00:15
  • Where'd you find the doc that edge supports them on a Microsoft site? Dug around but can't find it. – Joe Healy Oct 19 '15 at 18:04
  • Fwiw, the second among the list of alternative feedback conduits takes you to a page where you can vote in favor of the accept attribute support. Note that this resource specifically addresses web developers (imho incomprehensible, whether this features proves useful only depends on the end user preference and her file system organisation). – collapsar May 15 '17 at 11:14
  • It does not address the question: author is asking about `accept` html property. Not the `Accept` http header. – Anthony Raymond Aug 18 '17 at 09:28
  • This link https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7358734/ suggests that it's being tracked. According to https://caniuse.com/#feat=input-file-accept Egde will not support this any time soon. Hopefully they will fix this either way. – Mathias Pahlen Feb 15 '18 at 13:33
  • 1
    This is still not supported in Edge. Only 22 votes left to go. – Grim Jun 08 '18 at 21:17
  • As of now, Dec 2020, this appears to be supported on Edge. I'm looking here, as @mparizeau mentioned: caniuse.com/#feat=input-file-accept – Purplejacket Dec 06 '20 at 18:49
11

As @mparizeau reported, @JoeHealy's answr is about HTTP Accept header, which is not what the question is about.

To answer the question: at the moment, Edge does not support accept on <input type="file" />.

There used to be a bug tracker here, now it's just a SO redirected search -_-. Anyway, with the upcoming new Microsft Edge (Chromium) this issue will be resolved.

Anthony Raymond
  • 7,434
  • 6
  • 42
  • 59