MIME Types
path-mime-type
register-mime-type!
8.12

MIME Types🔗ℹ

Bogdan Popa <bogdan@defn.io>

This module provides utilities for working with MIME types. Its MIME type table is based on the table that the Nginx web server uses by default.

procedure

(path-mime-type p)  (or/c #f bytes?)

  p : path?
Given a path p, this function looks up the MIME type for that path (based on its extension) and returns it.

procedure

(register-mime-type! ext mime)  void?

  ext : symbol?
  mime : (or/c string? bytes?)
Adds mime as the mime type for ext in the global MIME type table. Replaces any existing entries for ext.