Actions
X-LIGHTTPD-send-file » History » Revision 7
« Previous |
Revision 7/9
(diff)
| Next »
glen, 2014-01-22 11:30
point to mod_fastcgi docs
X-sendfile¶
- Table of contents
- X-sendfile
- Description
- HowTo
- Notes
- External links
- X-Sendfile, X-LIGHTTPD-send-file (old alias)
- X-Sendfile2 (available since 1.4.24)
Description¶
Let lighty handle downloads of large files instead of using PHP.
see mod_fastcgi page for details
HowTo¶
Your typicall FastCGI setup + "allow-x-send-file" => "enable"
fastcgi.server = { ".php" => { "127.0.0.1" => { # .... "allow-x-send-file" => "enable" } } }
Tell PHP not to handle the file download, instead set up a header like this:
<?php /** * lighttpd's feature of X-Sendfile explained. * * @author Björn Schotte <schotte@mayflower.de> */ $file_on_harddisk = "/data/vhosts/bjoern/htdocs/acbd18db4cc2f85cedef654fccc4a4d8download.tar.gz"; $file_to_download = "download.tar.gz"; header( "Content-Disposition: attachment; filename=\"" . $file_to_download . '"' ); Header( "X-LIGHTTPD-send-file: " . $file_on_harddisk); ?>
Notes¶
Lighttpd 1.4.20 does not support Range-requests with X-LIGHTTPD-send-file.
Range-request support in lighttpd 1.5 with X-Sendfile is unknown.
External links¶
Updated by glen almost 11 years ago · 7 revisions