Upload images via API or web interface
POST /upload.phpSend a JSON object with base64 encoded image or external URL:
{
"image": "data:image/png;base64,iVBORw0KG...",
"source_url": "https://example.com/image.jpg"
} Note: Either image (base64) or source_url is required.
{
"success": true,
"data": {
"id": "IMG_abc123_1234567890",
"filename": "IMG_abc123_1234567890.png",
"original_name": "image.png",
"mime_type": "image/png",
"size": 102400,
"uploaded_at": "2026-02-25 15:30:00",
"url": "/images/IMG_abc123_1234567890.png"
}
}curl -X POST /upload.php \
-H "Content-Type: application/json" \
-d '{"image": "data:image/png;base64,..."}'const response = await fetch('/upload.php', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ image: base64String })
});
const result = await response.json();$ch = curl_init('/upload.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'image' => $base64Image
]));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json'
]);
$response = curl_exec($ch);Upload an image directly from your device
Image Upload API © 2026