← Back to MediaDrop

⚡ MediaDrop API

REST API for temporary media hosting with automatic expiration.

🔐 Authentication

All protected endpoints require an API key. Send it via:

Your API Key:
mdk_707f12e52a1b57e3710069fcd7d6c68ccf14030fda9a1261

📡 Endpoints

POST Upload File — ?api=upload

Upload a file directly (non-chunked). Max size depends on server's upload_max_filesize PHP setting.

ParameterTypeRequiredDescription
fileFileYesThe media file to upload
expirationStringNo30m, 1h, or 24h (default)
curl -X POST \
  -H "X-API-Key: mdk_707f12e52a1b57e3710069fcd7d6c68ccf14030fda9a1261" \
  -F "file=@photo.jpg" \
  -F "expiration=1h" \
  "https://media-drop.texaproject.com/index.php?api=upload"

Success Response:

{
  "success": true,
  "data": {
    "filename": "file_668f2a1b3c4d5.jpg",
    "url": "https://media-drop.texaproject.com/index.php/uploads/file_668f2a1b3c4d5.jpg",
    "type": "image",
    "size": 245678,
    "expiration": "1h",
    "expires_at": "2026-07-06T10:00:00+07:00"
  },
  "message": "Upload successful"
}

POST Chunk Upload — ?api=upload_chunk

Upload large files in chunks to bypass PHP upload limits. Send each chunk sequentially.

ParameterTypeRequiredDescription
file_chunkFileYesThe chunk data
file_idStringYesUnique session ID (alphanumeric)
file_nameStringYesOriginal filename with extension
chunk_indexIntegerYesCurrent chunk index (0-based)
total_chunksIntegerYesTotal number of chunks
expirationStringNo30m, 1h, or 24h (default)
💡 Recommended chunk size: 1MB. The final chunk returns the complete file info with public URL.

GET List Files — ?api=files

Get all active (non-expired) files with their details.

curl -H "X-API-Key: mdk_707f12e52a1b57e3710069fcd7d6c68ccf14030fda9a1261" "https://media-drop.texaproject.com/index.php?api=files"

GET File Info — ?api=file&id=FILENAME

Get details about a specific file including remaining time.

curl -H "X-API-Key: mdk_707f12e52a1b57e3710069fcd7d6c68ccf14030fda9a1261" "https://media-drop.texaproject.com/index.php?api=file&id=file_668f2a1b3c4d5.jpg"

DELETE Delete File — ?api=delete&id=FILENAME

Delete a file before its expiration. Also accepts POST method.

curl -X DELETE \
  -H "X-API-Key: mdk_707f12e52a1b57e3710069fcd7d6c68ccf14030fda9a1261" \
  "https://media-drop.texaproject.com/index.php?api=delete&id=file_668f2a1b3c4d5.jpg"

GET Status — ?api=status (Public)

Health check endpoint. No authentication required.

curl "https://media-drop.texaproject.com/index.php?api=status"

🌐 CORS

All API responses include Access-Control-Allow-Origin: *. Preflight (OPTIONS) requests are handled automatically.

❌ Error Handling

Errors return appropriate HTTP status codes with a JSON body:

{
  "success": false,
  "message": "Error description here",
  "code": 401
}
CodeMeaning
400Bad Request — missing or invalid parameters
401Unauthorized — invalid or missing API key
404Not Found — file or endpoint not found
405Method Not Allowed — wrong HTTP method
500Internal Server Error

📋 Supported File Types

Images: jpg, jpeg, png, gif, webp, bmp, tiff, svg, heic, heif, ico, psd

Videos: mp4, webm, avi, mov, mkv, flv, wmv, m4v, 3gp, ogv, mpeg, mpg, mts, m2ts