X-Git-Url: http://www.dolda2000.com/gitweb/?p=ashd.git;a=blobdiff_plain;f=doc%2Fsendfile.doc;h=a958030c30299964c43023f24724851a0c6c96c5;hp=2d304361899594845a001658c00a820688e2ef7c;hb=58c3e8b181230a562851ca4dadaeb38ace76a08f;hpb=cbc5f085ef03ebab38b9501acc3ec7aeca10e7d3 diff --git a/doc/sendfile.doc b/doc/sendfile.doc index 2d30436..a958030 100644 --- a/doc/sendfile.doc +++ b/doc/sendfile.doc @@ -7,19 +7,31 @@ sendfile - Static file handler for ashd(7) SYNOPSIS -------- -*sendfile* [*-c* 'CONTENT-TYPE'] 'METHOD' 'URL' 'REST' +*sendfile* [*-c* 'CONTENT-TYPE'] [*-f* 'FILE'] 'METHOD' 'URL' 'REST' DESCRIPTION ----------- *sendfile* serves static files by sending them exactly as they are to clients. It needs to be called with the `X-Ash-File` header added to -the request, as *dirplex*(1) does. +the request, as *dirplex*(1) does, unless the *-f* option is given. *sendfile* is a transient handler, as defined in *ashd*(7), and the 'METHOD', 'URL' and 'REST' arguments will normally be added by the parent handler. +Normally, *sendfile* will serve the file named by the `X-Ash-File` +header, and fail with a 404 error in case the rest string is not +empty. However, if the *-f* argument is given, the given 'FILE' will +always be served instead, and the `X-Ash-File` header and any rest +string is ignored. + +A file's MIME type may be specified explicitly either by using the +*-c* option, or by passing the header `X-Ash-Content-Type` to +*sendfile* with the MIME type of the file. That header might, for +instance, be set using the *set* directives of *dirplex*(1) or +*patplex*(1). + If a MIME-type is not explicitly specified, *sendfile* uses *libmagic*(3) to determine the MIME-type automatically. If *sendfile* is compiled with support for filesystem attributes (see *attr*(5) if @@ -43,6 +55,11 @@ OPTIONS Sends 'CONTENT-TYPE' as the file's MIME-type instead of trying to auto-detect the file type. +*-f* 'FILE':: + + Ignore the `X-Ash-File` header and force 'FILE' to be served + instead. Any remaining rest string is also ignored. + AUTHOR ------ Fredrik Tolf