加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 资源网站 > 资源 > 正文

html – 如何创建仅接受pdf和doc的文件字段

发布时间:2020-12-14 18:43:57 所属栏目:资源 来源:网络整理
导读:我需要使用输入类型文件只接受pdf和doc文件. input type="file" id="test" name="test" accept="application/msword,text/plain,application/pdf"/ 这是在Windows中工作,但在ubunthu中,它只接受pdf文件 解决方法 将您的代码更改为: input type="file" id="t
我需要使用输入类型文件只接受pdf和doc文件.
<input type="file" id="test" name="test" accept="application/msword,text/plain,application/pdf"/>

这是在Windows中工作,但在ubunthu中,它只接受pdf文件

解决方法

将您的代码更改为:
<input type="file" id="test" name="test" accept=".pdf,.doc"/>

扩展名应以点“.”开头.并用逗号分隔“,”

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读