Link to home
Start Free TrialLog in
Avatar of kgp43
kgp43Flag for Denmark

asked on

mod_xsendfile; empty files of 2KB each

Hi,

I have problems to use "mod_xsendfile".
It has been installed and configured on my VPS.

I use this in my "download.php" file to force downloads:

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

Open in new window


The file is downloaded correctly if I use "normal" download methods (readfile etc.).

By using mod_xsendfile I only get 2KB files.
$filepath is correct (worked with old download code, no mod_xsendfile).

This has been added to httpd.conf:

# Turn it on
XSendFile on

# Whitelist a target directory.
XSendFilePath /home/s10hate

Open in new window


The videos/files are located in this directory:
/home/s10hate/videos/...

Open in new window


I'm so lost, have used hours trying to find the error, no success :(
ASKER CERTIFIED SOLUTION
Avatar of kgp43
kgp43
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial