<input type="file" accept="application/msword" >
accept属性可以做到上传时,只显示规定的文件类型
accept=”application/pdf”
accept=”image/gif”
accept=”image/jpeg”
accept=”text/html”
accept=”video/x-msvideo”
accept = ‘image/*’
本文介绍如何使用HTML的input标签的accept属性来限制文件上传类型,包括PDF、GIF、JPEG、HTML、视频文件及所有图片格式。通过设置accept属性,可以提高用户体验,确保上传过程仅显示和接收指定类型的文件。
<input type="file" accept="application/msword" >
accept属性可以做到上传时,只显示规定的文件类型
accept=”application/pdf”
accept=”image/gif”
accept=”image/jpeg”
accept=”text/html”
accept=”video/x-msvideo”
accept = ‘image/*’

被折叠的 条评论
为什么被折叠?