gpt4 book ai didi

html - 如何使输入类型=文件应该只接受 .xlsx 和文件名包含子字符串

转载 作者:行者123 更新时间:2023-12-05 02:21:15 25 4
gpt4 key购买 nike

enter image description here

我想上传一个 .xlsx 文件到我的系统,条件是文件名包含指定的字符串。

例如:我要上传名称中包含“Paper”的文件,因此文件浏览器不应显示名称中不包含“Paper”的文件。

对于我在本文中附加的照片中的示例,不应显示文件“Order#...”。

我该怎么做?有没有可能实现这个想法?谢谢。

最佳答案

您可以使用 accept attribute
试试这个代码

<input type="file" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />

Read more here

关于html - 如何使输入类型=文件应该只接受 .xlsx 和文件名包含子字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35740636/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com