Commit | Line | Data |
---|---|---|
3d0adcf9 FT |
1 | sendfile(1) |
2 | =========== | |
3 | ||
4 | NAME | |
5 | ---- | |
6 | sendfile - Static file handler for ashd(7) | |
7 | ||
8 | SYNOPSIS | |
9 | -------- | |
10 | *sendfile* [*-c* 'CONTENT-TYPE'] 'METHOD' 'URL' 'REST' | |
11 | ||
12 | DESCRIPTION | |
13 | ----------- | |
14 | ||
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. | |
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 | |
21 | parent handler. | |
22 | ||
23 | If a MIME-type is not explicitly specified, *sendfile* uses | |
24 | *libmagic*(3) to determine the MIME-type automatically. If *sendfile* | |
25 | is compiled with support for filesystem attributes (see *attr*(5) if | |
26 | your system has support for such attributes), the attributes | |
27 | `user.ash-mime-type`, `user.mime-type`, `user.mime_type` or | |
28 | `user.Content-Type` will be checked, in that order, and if one is | |
29 | present on the file in question, its value will be used instead of | |
30 | using *libmagic*. | |
31 | ||
32 | *sendfile* also handles HTTP caching by supporting the `Last-Modified` | |
33 | and related headers. | |
34 | ||
35 | OPTIONS | |
36 | ------- | |
37 | ||
38 | *-c* 'CONTENT-TYPE':: | |
39 | ||
40 | Sends 'CONTENT-TYPE' as the file's MIME-type instead of trying | |
41 | to auto-detect the file type. | |
42 | ||
43 | AUTHOR | |
44 | ------ | |
45 | Fredrik Tolf <fredrik@dolda2000.com> | |
46 | ||
47 | SEE ALSO | |
48 | -------- | |
49 | *dirplex*(1), *ashd*(7) |