Dokumentasi API

Versi sederhana untuk integrasi cepat.

POST /upload

Form-data

Respons

{
  "success": true,
  "message": "File uploaded successfully",
  "url": "https://raw.githubusercontent.com/XshopTopup/db.arsyilla/main/<nama-acak.ext>"
}

Contoh

curl

curl -X POST https://url.arsyilla.my.id/upload \
  -F "file=@/path/gambar.jpg"

Node.js (fetch)

import fs from "fs"
import FormData from "form-data"
import fetch from "node-fetch"

const fd = new FormData()
fd.append("file", fs.createReadStream("./gambar.jpg"))
const r = await fetch("https://url.arsyilla.my.id/upload", { method: "POST", body: fd })
console.log(await r.json())

Browser

const fd = new FormData()
fd.append("file", fileInput.files[0])
const res = await fetch("/upload", { method: "POST", body: fd })
const json = await res.json()

Kode status

← Kembali ke Uploader