【问题标题】:html accept attribute working differently on different operating systemshtml 接受属性在不同操作系统上的工作方式不同
【发布时间】:2017-11-16 19:39:47
【问题描述】:

文件类型输入的接受属性是否因操作系统而异?

<input type="file" accept="video/*"  />

在 Mac 计算机上,此限制使得只能选择视频类型文件。但在 Windows 上,它仍然允许您选择任何内容。

每个操作系统是否必须使用不同的语法?还是我在看东西?

非常感谢任何帮助。

【问题讨论】:

  • 它在 Windows 上使用什么浏览器引擎?
  • 我正在使用 Electron
  • 我知道。如果您能说出它在 Windows 上使用的浏览器引擎,您将会得到更多人的帮助。

标签: html windows macos electron


【解决方案1】:

可能存在浏览器兼容性问题,请确保您使用的任何浏览器都是最新的。

另一种方法是说明您愿意接受的文件类型。

一些可能有用的链接:

Safari <input type="file" accept="video/*"> ignores mp4 files

How to make <input type="file"/> accept only these types?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-06
    • 1970-01-01
    • 2021-06-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多