文件流下載轉Blob時類型匹配,例如: ```javascript let blob = new Blob([data], {type: 'audio/mpeg'}); ``` Blob配置類型如下表所示,[詳細介紹](https://developer.mozilla.org/zh-CN/docs ...
文件流下載轉Blob時類型匹配,例如:
let blob = new Blob([data], {type: 'audio/mpeg'});
Blob配置類型如下表所示,詳細介紹
尾碼名 | 文件類型 | 類型(type) |
---|---|---|
.xls | Microsoft Excel | application/vnd.ms-excel |
.xlsx | Microsoft Excel (OpenXML) | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
.csv | CSV | text/csv |
.doc | Microsoft Word | application/msword |
.docx | Microsoft Word (OpenXML) | application/vnd.openxmlformats-officedocument.wordprocessingml.document |
application/pdf | ||
.ppt | Microsoft PowerPoint | application/vnd.ms-powerpoint |
.pptx | Microsoft PowerPoint (OpenXML) | application/vnd.openxmlformats-officedocument.presentationml.presentation |
.png | 攜帶型網路圖形(PNG) | image/png |
.gif | GIF | image/gif |
.jpeg | JPEG 圖片 | image/jpeg |
.jpg | JPEG 圖片 | image/jpeg |
.mp3 | MP3 音頻 | audio/mpeg |
.aac | AAC 音頻 | audio/aac |
.html | 超文本標記語言 (HTML) | text/html |
.css | CSS | text/css |
.js | JavaScript | text/javascript |
.json | JSON 格式 | application/json |
.abw | AbiWord 文檔 | application/x-abiword |
.arc | 存檔文檔(多個文件嵌入) | application/x-freearc |
.avi | AVI: 音頻視頻交錯 | video/x-msvideo |
.azw | 亞馬遜Kindle電子書格式 | application/vnd.amazon.ebook |
.bin | 任何類型的二進位數據 | application/octet-stream |
.bmp | Windows OS/2點陣圖圖形 | image/bmp |
.bz | BZip 存檔 | application/x-bzip |
.bz2 | BZip2 存檔 | application/x-bzip2 |
.csh | C-Shell 腳本 | application/x-csh |
.eot | MS嵌入式OpenType字體 | application/vnd.ms-fontobject |
.epub | 電子出版物(EPUB) | application/epub+zip |
.htm | 超文本標記語言 (HTML) | text/html |
.ico | Icon 格式 | image/vnd.microsoft.icon |
.ics | iCalendar 格式 | text/calendar |
.jar | Java Archive (JAR) | application/java-archive |
.jsonld | JSON-LD 格式 | application/ld+json |
.mid | 樂器數字介面(MIDI) | audio/midi audio/x-midi |
.midi | 樂器數字介面(MIDI) | audio/midi audio/x-midi |
.mjs | JavaScript 模塊 | text/javascript |
.mpeg | MPEG 視頻 | video/mpeg |
.mpkg | 蘋果安裝程式包 | application/vnd.apple.installer+xml |
.odp | OpenDocument演示文檔 | application/vnd.oasis.opendocument.presentation |
.ods | OpenDocument 電子錶格文件 | application/vnd.oasis.opendocument.spreadsheet |
.odt | OpenDocument 文本文檔 | application/vnd.oasis.opendocument.text |
.oga | OGG 音頻 | audio/ogg |
.ogv | OGG 視頻 | video/ogg |
.ogx | OGG | application/ogg |
.otf | OpenType 字體 | font/otf |
.rar | RAR 存檔 | application/x-rar-compressed |
.rtf | 富文本格式 (RTF) | application/rtf |
.sh | Bourne shell 腳本 | application/x-sh |
.svg | 可縮放矢量圖形 (SVG) | image/svg+xml |
.swf | 小型web格式 (SWF) or Adobe Flash document | application/x-shockwave-flash |
.tar | Tape 歸檔(TAR) | application/x-tar |
.tif | 標記圖像文件格式 (TIFF) | image/tiff |
.tiff | Tagged Image File Format (TIFF) | image/tiff |
.ttf | rueType 字體 | font/ttf |
.txt | Text | text/plain |
.vsd | Microsoft Visio | application/vnd.visio |
.wav | 波形音頻格式 | audio/wav |
.weba | WEBM 音頻 | audio/webm |
.webm | EBM 視頻 | video/webm |
.webp | WEBP 圖片 | image/webp |
.woff | 網頁開放字體格式 (WOFF) | font/woff |
.woff2 | 網頁開放字體格式 (WOFF) | font/woff2 |
.xhtml | XHTML | application/xhtml+xml |
.xml | XML | application/xml(普通用戶不可讀)、text/xml(普通用戶可讀) |
.xul | XUL | application/vnd.mozilla.xul+xml |
.zip | ZIP | application/zip |
.3gp | 3GPP audio/video 容器 | video/3gpp、audio/3gpp(不含視頻) |
.3g2 | 3GPP2 audio/video 容器 | video/3gpp2、audio/3gpp2(不含視頻) |
.7z | 7-zip | application/x-7z-compressed |