Static file export types serve files from the local filesystem.
The server determines the content type from the export type and
serves the file with appropriate headers. For these types, either
export-url is called with a directory hierarchy
(see Directory Exports) or the
URL's pathname is set via :pathname.
| Export Type | Content Type | Description |
| :html-file |
text/html; charset=utf-8 |
HTML document. Alternate extensions: .htm. |
| :text-file |
text/plain; charset=utf-8 |
Plain text file. Alternate extensions: .txt,
.lisp, .c, .h,
.sh, .script, .bib. |
| :lisp-file |
text/plain; charset=utf-8 |
Lisp source file. Alternate extensions: .lsp,
.cl, .asd. |
| :xml-file |
text/xml |
XML document. Alternate extensions: .rdf,
.daml, .opml. |
| :css-file |
text/css |
Cascading Style Sheet. |
| :java-script-file |
text/javascript |
JavaScript file. Alternate extensions: .js. |
| :json-data |
application/json |
JSON data file. |
| :gif-image |
image/gif |
GIF image (binary). |
| :jpeg-image |
image/jpeg |
JPEG image (binary). Alternate extensions: .jpe,
.jpg. |
| :png-image |
image/png |
PNG image (binary). |
| :tiff-image |
image/tiff |
TIFF image (binary). Alternate extensions: .tif. |
| :ico-image |
image/x-icon |
Icon image (binary). |
| :x-bitmap-image |
image/x-xbitmap |
X Bitmap image. |
| :pict-image |
image/pict |
PICT image (binary). Alternate extensions: .pic. |
| :basic-audio |
audio/basic |
Basic audio (binary). Alternate extensions: .snd. |
| :aiff-audio |
audio/aiff |
AIFF audio (binary). Alternate extensions: .aif. |
| :wav-audio |
audio/wav |
WAV audio (binary). |
| :midi-audio |
audio/midi |
MIDI audio (binary). Alternate extensions: .mid,
.kar, .rmi. |
| :mpeg-audio |
audio/mpeg |
MPEG audio (binary). Alternate extensions: .mp2,
.mp2a, .m2a. |
| :mpeg3-audio |
audio/mpeg3 |
MP3 audio (binary). Alternate extensions: .mp3,
.m3a. |
| :mp4-audio |
audio/mp4 |
MP4 audio (binary). |
| :aac-audio |
audio/mp4a-latm |
AAC audio (binary). Alternate extensions: .m4a,
.m4b, .m4p. |
| :pdf-file |
application/pdf |
PDF document (binary). |
| :postscript-file |
application/postscript |
PostScript file. Alternate extensions: .eps,
.epsf. |
| :compressed-file |
application/x-compressed |
Compressed archive (binary). Alternate extensions: .z,
.gz, .tgz. |
| :binary-file |
application/octet-stream |
Binary file. Alternate extensions: .bin,
.exe. |
| :word-file |
application/msword |
Microsoft Word (binary). Alternate extensions: .doc,
.docx. |
| :excel-file |
application/excel |
Microsoft Excel (binary). Alternate extensions: .xls,
.xlsx. |
| :power-point-file |
application/msppt |
Microsoft PowerPoint (binary). Alternate extensions: .pot,
.pptx. |
| :rtf-file |
text/richtext |
Rich Text Format. |
| :mark-down-file |
text/markdown |
Markdown file. Served as raw Markdown text. |
| :avi-video |
video/avi |
AVI video (binary). |
| :mpeg-video |
video/mpeg |
MPEG video (binary). Alternate extensions: .mpe,
.mpg, .m1v, .m2v. |
| :quicktime-video |
video/quicktime |
QuickTime video (binary). Alternate extensions: .mov,
.moov. |
| :mp4-video |
video/mp4 |
MP4 video (binary). |
Dynamic export types serve content computed at request time by Lisp functions.
| Export Type | Description | Key Parameters |
| :html-form |
Handle HTTP POST responses from a form. The response function receives
three arguments: the URL, the output stream, and a query-alist of
posted values. The form HTML itself is served from a static file
specified by :pathname. |
:response-function (required) — A function of (url stream query-alist).
:pathname (required) — The HTML file containing the form.
:header-function (optional) — Custom header function.
:server (optional) — A server object.
:character-set (optional) — Character set.
:durable-form-values (optional) — When true, form values persist across requests.
:maximum-upload-file-size (optional) — Maximum file upload size in bytes. |
| :html-computed-form |
Compute both the form (on GET) and its response (on POST).
The form function generates the HTML form dynamically; the response
function handles the submitted data. |
:form-function (required) — A function of (url stream) that generates the form.
:response-function (required) — A function of (url stream query-alist).
:header-function (optional) — Custom header function.
:character-set (optional) — Character set.
:durable-form-values (optional) — Persist form values.
:maximum-upload-file-size (optional) — Maximum upload size. |
| :computed-form |
Synonym for :html-computed-form. Newer name. |
Same as :html-computed-form. |
| :html-dynamic-form |
Serve a Dynamic Forms form object: GET renders the form page from its
definition; POST accepts the values through W3P presentation types with
automatic retry and runs the form's response function. Normally exported
via http:export-dynamic-form, which computes the URL from the
command-interface and form names; define-form's :export
option calls it at definition time. The standard export arguments apply. Requires the DYNAMIC-FORMS
system; see Chapter 13. |
:form (required) — The Dynamic Forms form object.
:recache-p (optional) — Recompute the form's cached HTML slots.
:recompute-url-p (optional) — Recompute the form's URL. |
Standard directory export types are automatically defined for all
registered file types. The macro define-standard-directory-export-types
creates directory export methods for these data type categories:
:html, :text, :lisp,
:image, :audio, :video,
:application, :world.
| Export Type | Description | Key Parameters |
| :markdown-html-file |
Markdown file rendered as HTML. The server converts the Markdown
source to HTML before transmission. This is the default for
.md files in directory exports; use
set-markdown-export-type to change to :text
rendering. |
:pathname (required) — The Markdown file. |
| :websocket |
An RFC 6455 WebSocket endpoint. The handshake is dispatched by URL
like any other GET, so the endpoint inherits virtual-host context,
authentication, access control and logging; the response function then
runs the session rather than writing a document. A GET without the
upgrade header fields is answered 426 Upgrade Required. One export
serves both transports: the HTTP/1.1 upgrade and RFC 8441's Extended
CONNECT over HTTP/2, which arrives as the GET it is defined to be
equivalent to. See Chapter 6. |
:response-function (required) — A function of one argument, the connection.
:subprotocols (optional) — Subprotocol names this endpoint will speak, preferred first.
:timeout (optional) — Idle seconds; defaults to *websocket-idle-timeout*.
:max-message-size (optional) — Largest message accepted, across all frames.
:max-frame-size (optional) — Largest single frame payload accepted.
:send-frame-size (optional) — Largest payload put in one outbound frame.
:ping-interval (optional) — Seconds of silence before a keepalive PING.
:pong-timeout (optional) — Seconds to wait for the PONG. |