Complete guide for HostZilla media hosting API
Upload files directly using multipart/form-data.
Content-Type: multipart/form-data (Required)
| Parameter | Type | Required | Description |
|---|---|---|---|
file |
file | Yes | Media file to upload (max 20MB) |
curl -X POST \
-F "file=@path/to/file.jpg"
const formData = new FormData();
formData.append('file', fileInput.files[0]);
fetch('', {
method: 'POST',
body: formData
})
.then(res => res.json())
.then(data => console.log(data));
Upload media from a URL.
| Parameter | Type | Required | Description |
|---|---|---|---|
url |
string | Yes | URL of media file (max 20MB) |
{
"data": "https://yourdomain.com/uploads/1732377600_file-abc.png",
"url": "https://yourdomain.com/uploads/1732377600_file-abc.png",
"shareable_url": "https://yourdomain.com/Ab3xY9/file-abc",
"short_code": "Ab3xY9",
"file_id": "file-abc",
"filename": "image.png",
"size": 83638,
"uploaded_on": "2025-11-23T14:11:52.833Z",
"media_type": "image/png"
}
{
"error": "Failed to download file from URL"
}