Secure image upload service with API key authentication
This is an API-only service. No web UI for uploads.
All requests require API key in headers:
| Header | Value |
|---|---|
X-API-Key |
Your API key |
Content-Type |
multipart/form-data |
| Parameter | Type | Description |
|---|---|---|
file |
File | Image file (JPG, PNG, WebP) • Max 5MB |
curl -X POST https://cdn.domain.com/upload.php \
-H "X-API-Key: your_api_key_here" \
-F "file=@/path/to/image.jpg"
const formData = new FormData();
formData.append('file', fileInput.files[0]);
fetch('https://cdn.domain.com/upload.php', {
method: 'POST',
headers: { 'X-API-Key': 'your_api_key_here' },
body: formData
})
.then(res => res.json())
.then(data => console.log(data));
{
"success": true,
"upload_id": 1,
"filename": "proof_abc123_1234567890.jpg",
"original_filename": "screenshot.jpg",
"file_size": 123456,
"mime_type": "image/jpeg",
"url": "https://cdn.domain.com/uploads/proof_abc123_1234567890.jpg",
"uploaded_at": "2025-10-29 14:37:44"
}
{
"error": "Error message"
}
| Code | Description |
|---|---|
| 400 | Bad request (invalid file, size, or type) |
| 401 | Unauthorized (invalid or missing API key) |
| 405 | Method not allowed |
| 500 | Server error |
• Each API key is tracked individually
• Upload history logged with IP address
• Automatic file validation (type & size)
• Unique filename prevents overwrites
• Protected uploads directory
Need an API key? Contact administrator.
Documentation: README.md