回答編集履歴
3
chousei
answer
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
const filename="test.gif";
|
4
4
|
const type=data.match(/image/.+?(?=;)/)[0];
|
5
5
|
const bin = atob(data.replace(/^.*,/, ''));
|
6
|
-
const buffer = new Uint8Array(bin.length).map((
|
6
|
+
const buffer = new Uint8Array(bin.length).map((_,x)=>bin.charCodeAt(x));
|
7
7
|
const blob = new Blob([buffer.buffer], {type});
|
8
8
|
const method="post";
|
9
9
|
const body=new FormData();
|
2
chousei
answer
CHANGED
@@ -3,10 +3,7 @@
|
|
3
3
|
const filename="test.gif";
|
4
4
|
const type=data.match(/image/.+?(?=;)/)[0];
|
5
5
|
const bin = atob(data.replace(/^.*,/, ''));
|
6
|
-
const buffer = new Uint8Array(bin.length);
|
6
|
+
const buffer = new Uint8Array(bin.length).map((x,y)=>bin.charCodeAt(y));
|
7
|
-
for (var i = 0; i < bin.length; i++) {
|
8
|
-
buffer[i] = bin.charCodeAt(i);
|
9
|
-
}
|
10
7
|
const blob = new Blob([buffer.buffer], {type});
|
11
8
|
const method="post";
|
12
9
|
const body=new FormData();
|
1
chousei
answer
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
```javascript
|
2
|
-
let data
|
2
|
+
let data="data:image/gif;base64,R0lGODdhEAAQAIACAAUFBfr6+iwAAAAAEAAQAAACJoyPqcsIrV6QE1hbscSGzl4dXJiJ1HM66ua1nPclG9ixNgzl+s4XADs=";
|
3
3
|
const filename="test.gif";
|
4
4
|
const type=data.match(/image/.+?(?=;)/)[0];
|
5
5
|
const bin = atob(data.replace(/^.*,/, ''));
|