html input file accept 上传文件类型限制格式 MIME 类型列表

例:

<input type="file" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" (change)="change($event)" multiple="false" class="ml-sm" />
File extension File type MIME type

.docx

Microsoft Office Word 2007 document

application/vnd.openxmlformats-officedocument.wordprocessingml.document

.docm

Office Word 2007 macro-enabled document

application/vnd.ms-word.document.macroEnabled.12

.dotx

Office Word 2007 template

application/vnd.openxmlformats-officedocument.wordprocessingml.template

.dotm

Office Word 2007 macro-enabled document template

application/vnd.ms-word.template.macroEnabled.12

.xlsx

Microsoft Office Excel 2007 workbook

application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

.xlsm

Office Excel 2007 macro-enabled workbook

application/vnd.ms-excel.sheet.macroEnabled.12

.xltx

Office Excel 2007 template

application/vnd.openxmlformats-officedocument.spreadsheetml.template

.xltm

Office Excel 2007 macro-enabled workbook template

application/vnd.ms-excel.template.macroEnabled.12

.xlsb

Office Excel 2007 binary workbook

application/vnd.ms-excel.sheet.binary.macroEnabled.12

.xlam

Office Excel 2007 add-in

application/vnd.ms-excel.addin.macroEnabled.12

.pptx

Microsoft Office PowerPoint 2007 presentation

application/vnd.openxmlformats-officedocument.presentationml.presentation

.pptm

Office PowerPoint 2007 macro-enabled presentation

application/vnd.ms-powerpoint.presentation.macroEnabled.12

.ppsx

Office PowerPoint 2007 slide show

application/vnd.openxmlformats-officedocument.presentationml.slideshow

.ppsm

Office PowerPoint 2007 macro-enabled slide show

application/vnd.ms-powerpoint.slideshow.macroEnabled.12

.potx

Office PowerPoint 2007 template

application/vnd.openxmlformats-officedocument.presentationml.template

.potm

Office PowerPoint 2007 macro-enabled presentation template

application/vnd.ms-powerpoint.template.macroEnabled.12

.ppam

Office PowerPoint 2007 add-in

application/vnd.ms-powerpoint.addin.macroEnabled.12

.sldx

Office PowerPoint 2007 slide

application/vnd.openxmlformats-officedocument.presentationml.slide

.sldm

Office PowerPoint 2007 macro-enabled slide

application/vnd.ms-powerpoint.slide.macroEnabled.12

.one

Microsoft Office OneNote 2007 section

application/msonenote

.onetoc2

Office OneNote 2007 TOC

application/msonenote

.onetmp

Office OneNote 2007 temporary file

application/msonenote

.onepkg

Office OneNote 2007 package

application/msonenote

.thmx

2007 Office system release theme

application/vnd.ms-officetheme

*.3gpp audio/3gpp, video/3gpp 3GPP Audio/Video
*.ac3 audio/ac3 AC3 Audio
*.asf allpication/vnd.ms-asf Advanced Streaming Format
*.au audio/basic AU Audio
*.css text/css Cascading Style Sheets
*.csv text/csv Comma Separated Values
*.doc application/msword MS Word Document
*.dot application/msword MS Word Template
*.dtd application/xml-dtd Document Type Definition
*.dwg image/vnd.dwg AutoCAD Drawing Database
*.dxf image/vnd.dxf AutoCAD Drawing Interchange Format
*.gif image/gif Graphic Interchange Format
*.htm text/html HyperText Markup Language
*.html text/html HyperText Markup Language
*.jp2 image/jp2 JPEG-2000
*.jpe image/jpeg JPEG
*.jpeg image/jpeg JPEG
*.jpg image/jpeg JPEG
*.js text/javascript, application/javascript JavaScript
*.json application/json JavaScript Object Notation
*.mp2 audio/mpeg, video/mpeg MPEG Audio/Video Stream, Layer II
*.mp3 audio/mpeg MPEG Audio Stream, Layer III
*.mp4 audio/mp4, video/mp4 MPEG-4 Audio/Video
*.mpeg video/mpeg MPEG Video Stream, Layer II
*.mpg video/mpeg MPEG Video Stream, Layer II
*.mpp application/vnd.ms-project MS Project Project
*.ogg application/ogg, audio/ogg Ogg Vorbis
*.pdf application/pdf Portable Document Format
*.png image/png Portable Network Graphics
*.pot application/vnd.ms-powerpoint MS PowerPoint Template
*.pps application/vnd.ms-powerpoint MS PowerPoint Slideshow
*.ppt application/vnd.ms-powerpoint MS PowerPoint Presentation
*.rtf application/rtf, text/rtf Rich Text Format
*.svf image/vnd.svf Simple Vector Format
*.tif image/tiff Tagged Image Format File
*.tiff image/tiff Tagged Image Format File
*.txt text/plain Plain Text
*.wdb application/vnd.ms-works MS Works Database
*.wps application/vnd.ms-works Works Text Document
*.xhtml application/xhtml+xml Extensible HyperText Markup Language
*.xlc application/vnd.ms-excel MS Excel Chart
*.xlm application/vnd.ms-excel MS Excel Macro
*.xls application/vnd.ms-excel MS Excel Spreadsheet
*.xlt application/vnd.ms-excel MS Excel Template
*.xlw application/vnd.ms-excel MS Excel Workspace
*.xml text/xml, application/xml Extensible Markup Language
*.zip aplication/zip Compressed Archive
上一篇:学习使用ExpressJS 4.0中的新Router


下一篇:CSS预处理框架:less,scss