Skip to content

JavaScript 保存文件的几种方法

Published: at 04:21 PMSuggest Changes

用 js 下载二进制流,保存图片等

FileSaver.js

import { saveAs } from 'file-saver';
FileSaver saveAs(Blob/File/Url, optional DOMString filename, optional Object { autoBom })

downloadjs

import download from 'downloadjs';
download(data, strFileName, strMimeType);

Previous Post
JS 将 Canvas 转换为 Blob 或 Image
Next Post
好用的 Windicss