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 A file's MIME type may be specified explicitly either by using the
30 *-c* option, or by passing the header `X-Ash-Content-Type` to
31 *sendfile* with the MIME type of the file. That header might, for
32 instance, be set using the *set* directives of *dirplex*(1) or
35 If a MIME-type is not explicitly specified, *sendfile* uses
36 *libmagic*(3) to determine the MIME-type automatically. If *sendfile*
37 is compiled with support for filesystem attributes (see *attr*(5) if
38 your system has support for such attributes), the attributes
39 `user.ash-mime-type`, `user.mime-type`, `user.mime_type` or
40 `user.Content-Type` will be checked, in that order, and if one is
41 present on the file in question, its value will be used instead of
44 *sendfile* supports the following HTTP features:
46 * Caching, using the `Last-Modified` and related headers.
48 * Partial content, using the `Range` and related headers.
55 Send 'CONTENT-TYPE' as the file's MIME-type instead of trying
56 to auto-detect the file type.
60 Ignore the `X-Ash-File` header and force 'FILE' to be served
61 instead. Any remaining rest string is also ignored.
65 Fredrik Tolf <fredrik@dolda2000.com>
69 *dirplex*(1), *psendfile*(1), *ashd*(7)