1

I just installed and configured mod_xsendfile on my apache2.2.15 web server (on centos6.5). Everything seems to be working fine except that I'm not sure it is. I added XSendFile On and XSendFilePath /path/to/downloaded/files to the virtualhost and I changed the headers to:

header('X-Sendfile: '.$file);
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' $file . '"');

Now, using google chrome inspector I can check the headers I get from the server whenever I download a file but mod_xsendfile is getting the X-Sendfile header out of the way and I can't find any message re sendfile in the logs. So how do I know for a fact that the download has been taken care of by apache ?

Thanks for your help :) Marc

marc99
  • 56
  • 5

1 Answers1

3

X-Sendfile removes X-Sendfile header. So in order to check if it works:

  • Check if header does not exist when X-Sendfile is enabled
  • Check if header exists if you disable X-Sendfile. Your file should not load

You can watch headers with curl:

curl -I URL

Hope it helps :)

Glueon
  • 3,514
  • 2
  • 22
  • 31