Spaces:
Paused
Paused
Update lib/uploader.js
Browse files- 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
|
| 11 |
-
const images = await
|
| 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
|