v1.0.0 BETA

Media Uploader

Upload any file. Automatic CDN URL. TTL-based expiration.

Drop your file here

Browse files or drag and drop

API Documentation

POST
/api/upload

Upload files using form-data. Supports all file formats.

Parameters

Name
Type
Description
file
File
Files to be uploaded (max 100MB)
expiryType
String
1d, 7d, 30d, or permanent

cURL Example

curl -X POST https://cdn.agungdevx.my.id/api/upload \
  -H "Content-Type: multipart/form-data" \
  -F "file=@/path/to/image.png" \
  -F "expiryType=7d"

Success Response (200)

{
  "success": true,
  "message": "File uploaded successfully",
  "data": {
    "id": "65a1b2c3d4e5f67890123456",
    "filename": "image.png",
    "size": 1234567,
    "fileType": "image",
    "cdnUrl": "https://cdn.agungdevx.my.id/image/20260212_210346_a1b2c3d4.jpg",
    "expiryType": "7d",
    "expiresAt": "2026-02-13T14:30:22.123Z",
    "uploadDate": "2026-02-13T14:30:22.123Z"
  }
}

Error Response (400/500)

{
  "success": false,
  "error": "Invalid expiry type. Must be 1d, 7d, 30d, or permanent"
}

Files will be automatically deleted after the active period ends (unless permanent). Use MongoDB TTL.