@lfkz/savedlfile
v1.0.4
Published
This is an ES6 module that processing files downloaded from the backend.
Downloads
1
Readme
Describe
EN This is an ES6 module that processing files downloaded from the backend.
CN 这是一个ES6模块,用于处理从后端下载的文件。
Explain
Common MIME types
| Extension | Kind of document | MIME Type | |-------------|---------------------------------------------|---------------------------------------------------------------------------| | .aac | AAC audio | audio/aac | | .abw | AbiWord document | application/x-abiword | | .arc | Archive document (multiple files embedded) | application/x-freearc | | .avif | AVIF image | image/avif | | .avi | AVI: Audio Video Interleave | video/x-msvideo | | .azw | Amazon Kindle eBook format | application/vnd.amazon.ebook | | .bin | Any kind of binary data | application/octet-stream | | .bmp | Windows OS/2 Bitmap Graphics | image/bmp | | .bz | BZip archive | application/x-bzip | | .bz2 | BZip2 archive | application/x-bzip2 | | .cda | CD audio | application/x-cdf | | .csh | C-Shell script | application/x-csh | | .css | Cascading Style Sheets (CSS) | text/css | | .csv | Comma-separated values (CSV) | text/csv | | .doc | Microsoft Word | application/msword | | .docx | Microsoft Word (OpenXML) | application/vnd.openxmlformats-officedocument.wordprocessingml.document | | .eot | MS Embedded OpenType fonts | application/vnd.ms-fontobject | | .epub | Electronic publication (EPUB) | application/epub+zip | | .gz | GZip Compressed Archive | application/gzip | | .gif | Graphics Interchange Format (GIF) | image/gif | | .htm, .html | HyperText Markup Language (HTML) | text/html | | .ico | Icon format | image/vnd.microsoft.icon | | .ics | iCalendar format | text/calendar | | .jar | Java Archive (JAR) | application/java-archive | | .jpeg, .jpg | JPEG images | image/jpeg | | .js | JavaScript | text/javascript | | .json | JSON format | application/json | | .jsonld | JSON-LD format | application/ld+json | | .mid, .midi | Musical Instrument Digital Interface (MIDI) | audio/midi, audio/x-midi | | .mjs | JavaScript module | text/javascript | | .mp3 | MP3 audio | audio/mpeg | | .mp4 | MP4 video | video/mp4 | | .mpeg | MPEG Video | video/mpeg | | .mpkg | Apple Installer Package | application/vnd.apple.installer+xml | | .odp | OpenDocument presentation document | application/vnd.oasis.opendocument.presentation | | .ods | OpenDocument spreadsheet document | application/vnd.oasis.opendocument.spreadsheet | | .odt | OpenDocument text document | application/vnd.oasis.opendocument.text | | .oga | OGG audio | audio/ogg | | .ogv | OGG video | video/ogg | | .ogx | OGG | application/ogg | | .opus | Opus audio | audio/opus | | .otf | OpenType font | font/otf | | .png | Portable Network Graphics | image/png | | .pdf | Adobe Portable Document Format (PDF) | application/pdf | | .php | Hypertext Preprocessor (Personal Home Page) | application/x-httpd-php | | .ppt | Microsoft PowerPoint | application/vnd.ms-powerpoint | | .pptx | Microsoft PowerPoint (OpenXML) | application/vnd.openxmlformats-officedocument.presentationml.presentation | | .rar | RAR archive | application/vnd.rar | | .rtf | Rich Text Format (RTF) | application/rtf | | .sh | Bourne shell script | application/x-sh | | .svg | Scalable Vector Graphics (SVG) | image/svg+xml | | .tar | Tape Archive (TAR) | application/x-tar | | .tif, .tiff | Tagged Image File Format (TIFF) | image/tiff | | .ts | MPEG transport stream | video/mp2t | | .ttf | TrueType Font | font/ttf | | .txt | Text, (generally ASCII or ISO 8859-n) | text/plain | | .vsd | Microsoft Visio | application/vnd.visio | | .wav | Waveform Audio Format | audio/wav | | .weba | WEBM audio | audio/webm | | .webm | WEBM video | video/webm | | .webp | WEBP image | image/webp | | .woff | Web Open Font Format (WOFF) | font/woff | | .woff2 | Web Open Font Format (WOFF) | font/woff2 | | .xhtml | XHTML | application/xhtml+xml | | .xls | Microsoft Excel | application/vnd.ms-excel | | .xlsx | Microsoft Excel (OpenXML) | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | | .xml | XML | text/xml, .xml, application/atom+xml, application/xml | | .xul | XUL | application/vnd.mozilla.xul+xml | | .zip | ZIP archive | application/zip | | .3gp | 3GPP audio/video container | video/3gpp; audio/3gpp if it doesn't contain video | | .3g2 | 3GPP2 audio/video container | video/3gpp2; audio/3gpp2 if it doesn't contain video | | .7z | 7-zip archive | application/x-7z-compressed |
Explain-CN
常见 MIME 类型
| 外延 | 文档类型 | MIME 类型(略:除了.3gp和.3g2) |
|-------------|-------------------------------------|------------------------------|
| .aac | AAC 音频
| .abw | AbiWord 文档
| .arc | 存档文档(嵌入多个文件)
| .avif | AVIF图像
| .avi | AVI:音频视频交错
| .azw | 亚马逊 Kindle 电子书格式
| .bin | 任何类型的二进制数据
| .bmp | Windows OS/2 位图图形
| .bz | BZip存档
| .bz2 | BZip2 存档
| .cda | CD 音频
| .csh | C-Shell 脚本
| .css | 级联样式表 (CSS)
| .csv | 逗号分隔值 (CSV)
| .doc | Microsoft Word
| .docx | Microsoft Word (OpenXML)
| .eot | MS Embedded OpenType 字体
| .epub | 电子出版物 (EPUB)
| .gz | GZip 压缩存档
| .gif | 图形交换格式 (GIF)
| .htm, .html | 超文本标记语言 (HTML)
| .ico | 图标格式
| .ics | iCalendar 格式
| .jar | Java 存档 (JAR)
| .jpeg, .jpg | JPEG图像
| .js | JavaScript
| .json | JSON 格式
| .jsonld | JSON-LD 格式
| .mid, .midi | 乐器数字接口 (MIDI)
| .mjs | JavaScript 模块
| .mp3 | MP3 音频
| .mp4 | MP4 视频
| .mpeg | MPEG 视频
| .mpkg | Apple 安装程序包
| .odp | OpenDocument 演示文档
| .ods | OpenDocument 电子表格文档
| .odt | OpenDocument 文本文档
| .oga | OGG 音频
| .ogv | OGG 视频
| .ogx | OGG 系列
| .opus | Opus 音频
| .otf | OpenType 字体
| .png | 便携式网络图形
| .pdf | Adobe 可移植文档格式 (PDF)
| .php | 超文本预处理器(个人主页)
| .ppt | Microsoft PowerPoint
| .pptx | Microsoft PowerPoint (OpenXML)
| .rar | RAR 存档
| .rtf | RTF 格式 (RTF)
| .sh | Bourne shell 脚本
| .svg | 可缩放矢量图形 (SVG)
| .tar | 磁带归档 (TAR)
| .tif, .tiff | 标记图像文件格式 (TIFF)
| .ts | MPEG 传输流
| .ttf | TrueType 字体
| .txt | 文本(通常为 ASCII 或 ISO 8859-n)
| .vsd | Microsoft Visio
| .wav | 波形音频格式
| .weba | WEBM 音频
| .webm | WEBM 视频
| .webp | WEBP 图片
| .woff | Web 开放字体格式 (WOFF)
| .woff2 | Web 开放字体格式 (WOFF)
| .xhtml | XHTML
| .xls | Microsoft Excel
| .xlsx | Microsoft Excel (OpenXML)
| .xml | XML
| .xul | XUL
| .zip | ZIP 存档
| .3gp | 3GPP 音频/视频容器 | video/3gpp; audio/3gpp 如果它不包含视频 |
| .3g2 | 3GPP2 音频/视频容器 | video/3gpp2; audio/3gpp2 如果它不包含视频|
| .7z | 7-zip 存档
Example
import savedlfile from '@lfkz/savedlfile'
axios.get("http://localhost:80", { responseType: "blob" }).then(
(response) => {
savedlfile([ response.data ], 'image/png', 'img')
},
(error) => {
console.log(error.message);
}
);