Developer documentation
One endpoint.
Permanent files.
Upload files melalui multipart/form-data dan dapatkan URL permanent yang bisa langsung disimpan atau dibagikan. Support chunked upload untuk file besar hingga 2GB.
Security
Authentication
Semua endpoint admin memerlukan header X-Admin-Key dengan API key yang valid. Public endpoints (upload, retrieve) tidak memerlukan authentication.
X-Admin-Key: your-admin-api-key-here
Make a request
Upload via cURL
Kirim file menggunakan multipart/form-data. Nama field file yang digunakan adalah file. Max file size: 100MB.
Gunakan file lokal dalam format yang didukung.
POST sebagai multipart/form-data ke endpoint upload.
Ambil field url dari JSON response.
curl -X POST https://daffafile.ayiem.workers.dev/api/upload \
-F "file=@/path/to/image.png"
Response:
{
"success": true,
"url": "https://daffafile.ayiem.workers.dev/api/aZ3kq9",
"id": "aZ3kq9",
"contentType": "image/png",
"size": 245678
}
Large files
Chunked Upload
Untuk file lebih besar dari 100MB (max 2GB), gunakan chunked upload dengan 3 langkah:
1. Initialize Upload Session
curl -X POST https://daffafile.ayiem.workers.dev/api/upload/chunked/init \
-H "Content-Type: application/json" \
-d '{"filename":"video.mp4","totalSize":524288000,"totalChunks":25}'
2. Upload Chunks
curl -X POST https://daffafile.ayiem.workers.dev/api/upload/chunked/abc123xyz/0 \
-F "chunk=@chunk0.bin"
Upload setiap chunk (0-indexed). Setiap chunk max 20MB.
3. Complete Upload
curl -X POST https://daffafile.ayiem.workers.dev/api/upload/chunked/abc123xyz/complete
{
"success": true,
"url": "https://daffafile.ayiem.workers.dev/api/aZ3kq9",
"id": "aZ3kq9",
"contentType": "video/mp4",
"size": 524288000
}
Get files
Retrieve File
Dapatkan file dengan permanent URL. Redirect ke storage backend.
curl https://daffafile.ayiem.workers.dev/api/aZ3kq9
Response: File binary dengan headers yang sesuai.
Get File Info
curl https://daffafile.ayiem.workers.dev/api/aZ3kq9/info
{
"success": true,
"id": "aZ3kq9",
"contentType": "image/png",
"size": 245678,
"createdAt": "2026-08-21T20:00:00.000Z"
}
Admin only
Delete File
Soft delete file (memerlukan admin key).
curl -X DELETE https://daffafile.ayiem.workers.dev/api/admin/aZ3kq9 \
-H "X-Admin-Key: your-admin-key"
File compatibility
Supported Formats
Daffa File menerima pelbagai format file:
Quotas
Rate Limits & Quotas
Troubleshooting