input [type = file]的Accept属性允许其他扩展 [英] Accept attribute for input[type=file] allows other extensions

查看:68
本文介绍了input [type = file]的Accept属性允许其他扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道为什么此输入接受.php文件扩展名吗?

Anybody knows why this input accepts .php file extensions?

((至少在最新版本的chrome中)

( At least in the latest version of chrome )

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

推荐答案

这显然是Mac OS的唯一错误.
我无法从我的win10 VM中重现它,但仍然在v.55.0.2861.0 canary中存在.

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.

问题似乎来自.txt.
设置此扩展名后,它就像可以接受任何text/*文件.

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

您可以加注处理铬的问题相同的潜在问题(扩展名不同).

You can star this chromium issue which treats of the same underlying issue (with a different extension).

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

这篇关于input [type = file]的Accept属性允许其他扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆