我刚刚在我的apache2.2.15 web服务器(在centos6.5上)上安装并configuration了mod_xsendfile。 一切似乎工作正常,但我不知道它是。 我将XSendFile On和XSendFilePath /path/to/downloaded/files到虚拟主机,并将标题更改为:
header('X-Sendfile: '.$file); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="' $file . '"');
现在,使用谷歌铬检查器,我可以检查我从服务器获得的标题,每当我下载一个文件,但mod_xsendfile获取的X-Sendfile标题的方式,我找不到任何消息发送文件在日志中。 那么我怎么知道下载已经被apache照顾了呢?
谢谢你的帮助:) Marc
X-Sendfile删除X-Sendfile标题。 所以为了检查它是否工作:
你可以看curl的标题:
curl -I URL
希望能帮助到你 :)