lib: Fixed mblock bug for epoll.
[ashd.git] / doc / sendfile.doc
... / ...
CommitLineData
1sendfile(1)
2===========
3
4NAME
5----
6sendfile - Static file handler for ashd(7)
7
8SYNOPSIS
9--------
10*sendfile* [*-c* 'CONTENT-TYPE'] [*-f* 'FILE'] 'METHOD' 'URL' 'REST'
11
12DESCRIPTION
13-----------
14
15*sendfile* serves static files by sending them exactly as they are to
16clients. It needs to be called with the `X-Ash-File` header added to
17the request, as *dirplex*(1) does, unless the *-f* option is given.
18
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
21parent handler.
22
23Normally, *sendfile* will serve the file named by the `X-Ash-File`
24header, and fail with a 404 error in case the rest string is not
25empty. However, if the *-f* argument is given, the given 'FILE' will
26always be served instead, and the `X-Ash-File` header and any rest
27string is ignored.
28
29A 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
32instance, be set using the *set* directives of *dirplex*(1) or
33*patplex*(1).
34
35If a MIME-type is not explicitly specified, *sendfile* uses
36*libmagic*(3) to determine the MIME-type automatically. If *sendfile*
37is compiled with support for filesystem attributes (see *attr*(5) if
38your 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
41present on the file in question, its value will be used instead of
42using *libmagic*.
43
44*sendfile* supports the following HTTP features:
45
46 * Caching, using the `Last-Modified` and related headers.
47
48 * Partial content, using the `Range` and related headers.
49
50OPTIONS
51-------
52
53*-c* 'CONTENT-TYPE'::
54
55 Send 'CONTENT-TYPE' as the file's MIME-type instead of trying
56 to auto-detect the file type.
57
58*-f* 'FILE'::
59
60 Ignore the `X-Ash-File` header and force 'FILE' to be served
61 instead. Any remaining rest string is also ignored.
62
63AUTHOR
64------
65Fredrik Tolf <fredrik@dolda2000.com>
66
67SEE ALSO
68--------
69*dirplex*(1), *psendfile*(1), *ashd*(7)