Identify a file type
ai_file_identifyDetect a file’s real type and MIME from content, not its name, and flag extension mismatches. It also reports size, SHA-256, and text encoding to verify file identity safely.
Instructions
Find out what a file really is from its content (magic bytes, via file-type: images, video, audio, archives, Office, PDF, fonts, executables… ~150 formats), not its name. Reports the detected type and MIME, whether the extension disagrees with the content, size, SHA-256, and for text files an encoding guess (UTF-8, UTF-8/16/32 with BOM, UTF-16 without BOM, ASCII, 8-bit legacy) plus a text kind (JSON, XML, SVG, HTML…). Accepts a file path or base64. Nothing is executed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | The file to identify: a local file path (absolute, or relative to the server's --root) or base64 data (raw or a data: URI). | |
| name | No | File name to compare the extension against (handy for base64 input). Default: the path's own name. |