X-Git-Url: http://www.dolda2000.com/gitweb/?a=blobdiff_plain;f=doc%2Fsendfile.doc;h=57467b1f8fc61f36754d78f36e9b849877d7fc4b;hb=595adb9922885c2a05bc6917ee8f8f02f496e618;hp=2d304361899594845a001658c00a820688e2ef7c;hpb=cbc5f085ef03ebab38b9501acc3ec7aeca10e7d3;p=ashd.git diff --git a/doc/sendfile.doc b/doc/sendfile.doc index 2d30436..57467b1 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 @@ -40,13 +52,18 @@ OPTIONS *-c* 'CONTENT-TYPE':: - Sends 'CONTENT-TYPE' as the file's MIME-type instead of trying + Send '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 SEE ALSO -------- -*dirplex*(1), *ashd*(7) +*dirplex*(1), *psendfile*(1), *ashd*(7)