Spaces:
Paused
Paused
Update lib/uploader.js
Browse files- lib/uploader.js +2 -2
lib/uploader.js
CHANGED
|
@@ -13,7 +13,7 @@ async function Uploader(input) {
|
|
| 13 |
const filenames = "images_" + Math.floor(1000 + Math.random() * 9000) + "." + types.ext;
|
| 14 |
// memasukan data ke formdata
|
| 15 |
const form = new FormData();
|
| 16 |
-
form.append("image", Buffer.from(
|
| 17 |
filename: filenames,
|
| 18 |
contentType: types.mime
|
| 19 |
});
|
|
@@ -35,7 +35,7 @@ async function Uploader(input) {
|
|
| 35 |
return res.data;
|
| 36 |
} else if(typeof input == "object") {
|
| 37 |
// data
|
| 38 |
-
const types = await fileTypeFromBuffer(
|
| 39 |
const filenames = "images_" + Math.floor(1000 + Math.random() * 9000) + "." + types.ext;
|
| 40 |
// memasukan data ke formdata
|
| 41 |
const form = new FormData();
|
|
|
|
| 13 |
const filenames = "images_" + Math.floor(1000 + Math.random() * 9000) + "." + types.ext;
|
| 14 |
// memasukan data ke formdata
|
| 15 |
const form = new FormData();
|
| 16 |
+
form.append("image", Buffer.from(images, "binary"), {
|
| 17 |
filename: filenames,
|
| 18 |
contentType: types.mime
|
| 19 |
});
|
|
|
|
| 35 |
return res.data;
|
| 36 |
} else if(typeof input == "object") {
|
| 37 |
// data
|
| 38 |
+
const types = await fileTypeFromBuffer(input);
|
| 39 |
const filenames = "images_" + Math.floor(1000 + Math.random() * 9000) + "." + types.ext;
|
| 40 |
// memasukan data ke formdata
|
| 41 |
const form = new FormData();
|