6 sendfile - Static file handler for ashd(7)
10 *sendfile* [*-c* 'CONTENT-TYPE'] [*-f* 'FILE'] 'METHOD' 'URL' 'REST'
15 *sendfile* serves static files by sending them exactly as they are to
16 clients. It needs to be called with the `X-Ash-File` header added to
17 the request, as *dirplex*(1) does, unless the *-f* option is given.
19 *sendfile* is a transient handler, as defined in *ashd*(7), and the
20 'METHOD', 'URL' and 'REST' arguments will normally be added by the
23 Normally, *sendfile* will serve the file named by the `X-Ash-File`
24 header, and fail with a 404 error in case the rest string is not
25 empty. However, if the *-f* argument is given, the given 'FILE' will
26 always be served instead, and the `X-Ash-File` header and any rest
29 If a MIME-type is not explicitly specified, *sendfile* uses
30 *libmagic*(3) to determine the MIME-type automatically. If *sendfile*
31 is compiled with support for filesystem attributes (see *attr*(5) if
32 your system has support for such attributes), the attributes
33 `user.ash-mime-type`, `user.mime-type`, `user.mime_type` or
34 `user.Content-Type` will be checked, in that order, and if one is
35 present on the file in question, its value will be used instead of
38 *sendfile* supports the following HTTP features:
40 * Caching, using the `Last-Modified` and related headers.
42 * Partial content, using the `Range` and related headers.
49 Sends 'CONTENT-TYPE' as the file's MIME-type instead of trying
50 to auto-detect the file type.
54 Ignore the `X-Ash-File` header and force 'FILE' to be served
55 instead. Any remaining rest string is also ignored.
59 Fredrik Tolf <fredrik@dolda2000.com>
63 *dirplex*(1), *ashd*(7)