html中input的type=file上传文件时限制各种文件格式accept属性值整理

.xml   text/xml, application/xml                                                 Extensible Markup Language
.js    text/javascript, application/javascript                                   JavaScript

.json  application/json                                                          JavaScript Object Notation
.pdf   application/pdf                                                           Portable Document Format
.rtf   application/rtf, text/rtf                                                 Rich Text Format
.ogg   application/ogg, audio/ogg                                                Ogg Vorbis

.doc   application/msword                                                        MS Word Document
.docx  application/vnd.openxmlformats-officedocument.wordprocessingml.document
.dot   application/msword                                                        MS Word Template
.dotx  application/vnd.openxmlformats-officedocument.wordprocessingml.template
.ppt   application/vnd.ms-powerpoint                                             MS PowerPoint Presentation
.pptx  application/vnd.openxmlformats-officedocument.presentationml.presentation
.pot   application/vnd.ms-powerpoint                                             MS PowerPoint Template
.potx  application/vnd.openxmlformats-officedocument.presentationml.template
.pps   application/vnd.ms-powerpoint                                             MS PowerPoint Slideshow
.ppsx  application/vnd.openxmlformats-officedocument.presentationml.slideshow
.xlc   application/vnd.ms-excel                                                  MS Excel Chart
.xlm   application/vnd.ms-excel                                                  MS Excel Macro
.xls   application/vnd.ms-excel                                                  MS Excel Spreadsheet
.xlsx  application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
.xlsm  application/vnd.ms-excel.addin.macroEnabled.12
.xlsb  application/vnd.ms-excel.sheet.binary.macroEnabled.12
.xlt   application/vnd.ms-excel                                                  MS Excel Template
.xltx  application/vnd.openxmlformats-officedocument.spreadsheetml.template
.xlw   application/vnd.ms-excel                                                  MS Excel Workspace
.wdb   application/vnd.ms-works                                                  MS Works Database
.wps   application/vnd.ms-works                                                  Works Text Document
.mpp   application/vnd.ms-project                                                MS Project Project
.sldx  application/vnd.openxmlformats-officedocument.presentationml.slide
.asf   application/vnd.ms-asf                                                    Advanced Streaming Format
.dtd   application/xml-dtd                                                       Document Type Definition
.xhtml application/xhtml+xml                                                     Extensible HyperText Markup Language
.zip   aplication/zip                                                            Compressed Archive

参考:https://blog.csdn.net/sxg0205/article/details/48731031
参考:https://www.cnblogs.com/haocool/p/3431181.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值