Skip to content

Commit 3c01883

Browse files
authored
MIMEタイプ指定
1 parent 787aaa9 commit 3c01883

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

downloadFile.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { CONTENT_TYPE } from "https://code4sabae.github.io/js/CONTENT_TYPE.js";
22

3-
export const downloadFile = (name, uint8arry) => {
3+
const downloadFile = (name, uint8arry) => {
44
const ext = name.split('.').pop().toLowerCase();
55
const mime = CONTENT_TYPE[ext] || "application/octet-stream";
66
const blob = new Blob([uint8arry], { type: mime });
@@ -13,3 +13,5 @@ export const downloadFile = (name, uint8arry) => {
1313
link.remove();
1414
URL.revokeObjectURL(url);
1515
};
16+
17+
export { downloadFile };

0 commit comments

Comments
 (0)