loading...
Kirimkan file Anda menggunakan metode POST dengan format multipart/form-data.
| Parameter | Tipe | Wajib | Keterangan |
|---|---|---|---|
file |
Binary | Ya | File gambar, dokumen, atau video (Maks 200MB). |
const formData = new FormData();
formData.append('file', fileInput.files[0]);
fetch('[BASE_URL]/cdn/api.php', {
method: 'POST',
body: formData
})
.then(res => res.json())
.then(data => console.log(data));
$file = new CURLFile('image.jpg');
$ch = curl_init('[BASE_URL]/cdn/api.php');
curl_setopt($ch, CURLOPT_POSTFIELDS, ['file' => $file]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
echo $response;
{
"status": "success",
"url": "[BASE_URL]/f/custom123.jpg",
"filename": "custom123.jpg",
"originalName": "foto.jpg"
}
{
"status": "error",
"message": "Upload limit exceeded (200MB max)"
}