input type=file accept中限制文件类型pdf、doc、docx、 jpg、 png、xls 、xlsx等格式

accept="application/msexcel,application/msword,application/pdf,image/jpeg,image/png,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document"


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


accept表示可以上传文件类型,image表示图片,*表示所有支持的格式。 accept可以指定如下信息: image.png image.png image.png

本文章由javascript技术分享原创和收集

发表评论 (审核通过后显示评论):