Update index.js
Browse files
index.js
CHANGED
|
@@ -25,7 +25,7 @@ const post = async (url, form, headers = {}) => {
|
|
| 25 |
async function uploadBuffer(buffer) {
|
| 26 |
//file: (binary)
|
| 27 |
//expirationTime: 1
|
| 28 |
-
let mime = await
|
| 29 |
let formData = new FormData()
|
| 30 |
formData.append('file', buffer, `${Date.now()}.${mime.ext}`)
|
| 31 |
formData.append('expirationTime', 1)
|
|
|
|
| 25 |
async function uploadBuffer(buffer) {
|
| 26 |
//file: (binary)
|
| 27 |
//expirationTime: 1
|
| 28 |
+
let mime = await FileType.fromBuffer(buffer)
|
| 29 |
let formData = new FormData()
|
| 30 |
formData.append('file', buffer, `${Date.now()}.${mime.ext}`)
|
| 31 |
formData.append('expirationTime', 1)
|