【问题标题】:html file input with accept="image/jpeg" also accepts heic on Android带有 accept=\"image/jpeg\" 的 html 文件输入在 Android 上也接受 heic
【发布时间】:2022-10-17 21:31:25
【问题描述】:

我有以下html输入:

<input type="file" name="file" accept="image/jpeg">

当我使用我的(Android 11)手机选择文件时,我也可以选择并上传 .heic-Files。在 Windows 上,一切都按预期工作。

有人有线索吗?

【问题讨论】:

  • 您使用哪种浏览器?
  • 我在我的 Android 手机上使用 Chrome。并从 Chrome,Android / 或三星的默认文件浏览器,不确定,启动以选择图像。
  • 尝试不同的浏览器和设备。

标签: android html file-upload


【解决方案1】:

如果您想从 input 字段中获取特定的图像类型,您可以这样做:

<input type="file" name="file" accept=".jpeg, .jpg">

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-09-10
    • 1970-01-01
    • 1970-01-01
    • 2011-03-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多