I'm hoping other xSendFile folks could shed a little light on this.

If I place an Xfile header directly in index.php, I can get a file to download just fine. However, if I use any Drupal alias, the server doesn't serve up the file and I get this error:

"The given path was above the root path: xsendfile: unable to find file: [name of file]"

After doing a search (and reading the INSTALL file), it looks like an option for an older version of xsendfile is to set "XSendFileAllowAbove on" in the .htaccess file. However, the latest version did away with this setting and you whitelist folders using "XSendFilePath [path]". I get a 500 error when trying to set this in .htaccess (maybe it's a server config issue?).

I assume that the whitelisting is for files that are being served up, rather than files that are doing the serving. But is there something I need to do to get the serving file (index.php) working with aliases?

Any illumination that can be shed on this issue would be much appreciated.

Thanks!
Chris

Comments

JedahsMinistry’s picture

Any luck with this? And what do you mean by placing an Xfile header in index.php?

I can't even set XSendFile On in Drupal's .htaccess as it'll crash the whole thing. I managed to do it with a a tiny downloads-only script in a separate dir just fine though, so I know mod_xsendfile is installed and working.

JedahsMinistry’s picture

After contacting the author of the Apache module and pouring over the documentation, it turned out I was missing an Apache module (Fileinfo I believe) and XSendFilePath cannot be set in .htaccess, it has to be done in the server config.

imclean’s picture

Component: Code » Documentation
Issue summary: View changes

Sendfile docs: https://tn123.org/mod_xsendfile/

The following can go anywhere within the VirtualServer config (not .htaccess as you've found):

XSendFile on
XSendFilePath /full/path/to/files

Module documentation should probably be updated.