Skip to content

Commit

Permalink
𝙂𝙖𝙩𝙖 π˜Ώπ™žπ™€π™¨
Browse files Browse the repository at this point in the history
  • Loading branch information
GataNina-Li authored Sep 10, 2024
1 parent b4f860c commit 58968c5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/uploadImage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fetch from 'node-fetch';
import { FormData, Blob } from 'formdata-node';
import { fileTypeFromBuffer } from 'file-type';
import fetch from 'node-fetch'
import { FormData, Blob } from 'formdata-node'
import { fileTypeFromBuffer } from 'file-type'

/**
* Upload file to qu.ax
Expand All @@ -21,7 +21,7 @@ const form = new FormData()
const blob = new Blob([buffer.toArrayBuffer()], { type: mime })
form.append('files[]', blob, 'tmp.' + ext)
const res = await fetch('https://qu.ax/upload.php', { method: 'POST', body: form })
const result = await res.json();
const result = await res.json()
if (result && result.success) {
return result.files[0].url
} else {
Expand Down

0 comments on commit 58968c5

Please sign in to comment.