Khrisna commited on
Commit
b037b57
·
verified ·
1 Parent(s): daabc80

Update lib/uploader.js

Browse files
Files changed (1) hide show
  1. lib/uploader.js +2 -2
lib/uploader.js CHANGED
@@ -7,8 +7,8 @@ async function Uploader(input) {
7
  try {
8
  if(typeof input == "string") {
9
  // data
10
- const res = await fetch(input);
11
- const images = await res.arrayBuffer();
12
  const types = await fileTypeFromBuffer(images);
13
  const filenames = "images_" + Math.floor(1000 + Math.random() * 9000) + "." + types.ext;
14
  // memasukan data ke formdata
 
7
  try {
8
  if(typeof input == "string") {
9
  // data
10
+ const resp = await fetch(input);
11
+ const images = await resp.arrayBuffer();
12
  const types = await fileTypeFromBuffer(images);
13
  const filenames = "images_" + Math.floor(1000 + Math.random() * 9000) + "." + types.ext;
14
  // memasukan data ke formdata