Search code examples
phpapachex-sendfile

X-SendFile - detect if XSendFilePath is set


I just started using the XSendFile apache module to serve files. Except for the fact that I cannot know when a download is complete, I guess it's pretty good...

One problem though, I found out that xsend will return 0 bytes files if XSendFilePath is not set in the apache or the vhost conf

So my question is, can I detect if XSendFilePath is set or not?

With PHP I can detect if the xsend module is loaded, but it's no good to me if I am not sure it's going to work...

So more generally, is it possible to detect a specific apache/vhost directive?


Solution

  • Well after looking around for a while, there's no "nice" way of doing this.

    The only way is to monitor the apache logs, and heavily use string search into them, detect when the file you started streaming appears, and detect when it's over.

    At the end I did not implement this solution, I kept using PHP to stream the files... and I hadd to increase the server memory limit for it to work with large files...