About this endpoint
What it does
Validates an uploaded file by comparing the detected file type against the file extension and the MIME type declared by the client. It returns the original file name, extracted extension, declared MIME type, detected type, a boolean validity flag, and a human-readable message.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| file | String | Yes | The file to validate. Maximum 100 MB. Binary upload. |
Response
Returns a JSON object with file_name, extension, mime_type, detected_type, is_valid, and message fields. The response confirms whether the detected type matches both the extension and the declared MIME, and includes the relevant file details.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| file_name | String | Yes | Original filename as provided by the client. |
| extension | String | Yes | Lowercased file extension extracted from file_name. |
| mime_type | String | Yes | MIME type declared by the client (multipart Content-Type field). Nullable; null if not provided. |
| detected_type | String | Yes | MIME type detected from the file's binary content. Nullable; null if detection failed. |
| is_valid | Boolean | Yes | true when detected type matches both the extension and the declared MIME. |
| message | String | Yes | Human-readable validation result or mismatch explanation. |
Notes
The uploaded file has a maximum size of 100 MB.