API Reference › Mime › Mime.of
method

Mime.of

Mime.of(path) -> string

Returns the MIME type inferred from the file extension (e.g. hero.png → image/png), or application/octet-stream for an unknown extension. A pure lookup — it does not open the file.

Parameters

paththe path or filename

Example

program MimeOf {
  entry {
    if Mime.of("hero.png") == "image/png" { print(1) }
  }
}
← All symbols