Skip to content

MIME Type

Type Registry

MIME Type

representation.file.mime_type

MIME type (media type) for files and HTTP content (e.g., text/plain, application/json, image/png).

Domain representationfile
Casts to VARCHAR
Scope broad_characters

Try it

CLI
$ finetype infer -i "text/plain"
→ representation.file.mime_type

DuckDB

Detect
SELECT finetype('text/plain');
-- → 'representation.file.mime_type'
Cast expression
LOWER(CAST({col} AS VARCHAR))
Safe cast pipeline
-- Normalise and cast in one step
SELECT TRY_CAST(finetype_cast(my_column) AS VARCHAR) AS clean_value
FROM my_table
WHERE finetype(my_column) = 'representation.file.mime_type';

Struct Expansion

charset: REGEXP_EXTRACT({col}, 'charset=([^;]+)')
subtype: REGEXP_EXTRACT({col}, '/([^;]+)')
type: REGEXP_EXTRACT({col}, '^([^/]+)')

JSON Schema

finetype schema representation.file.mime_type
{
  "$id": "https://noon.sh/schemas/representation.file.mime_type",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "MIME type (media type) for files and HTTP content (e.g., text/plain, application/json, image/png).",
  "examples": [
    "text/plain",
    "application/json",
    "image/png",
    "text/html; charset=utf-8",
    "application/vnd.ms-excel"
  ],
  "pattern": "^[a-zA-Z]+/[a-zA-Z0-9.+\\-]+(;.*)?$",
  "title": "MIME Type",
  "type": "string"
}

Examples

text/plainapplication/jsonimage/pngtext/html; charset=utf-8application/vnd.ms-excel

Also known as

content_typemedia_type

Types in representation