Accept attribute for input[type=file] allows other

2019-07-26 08:48发布

Anybody knows why this input accepts .php file extensions?

( At least in the latest version of chrome )

<input type="file" accept=".doc,.pdf,.txt,.rtl">

enter image description here

标签: html file
1条回答
别忘想泡老子
2楼-- · 2019-07-26 09:39

This is apparently a Mac Os only bug.
I wasn't able to reproduce it from my win10 VM, but it is still there in v.55.0.2861.0 canary.


The problem seems to come from the .txt.
It's like it will accept any text/* files, when this extension is set.

You should open an issue on chrome's bug tracker.

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

查看更多
登录 后发表回答