LiteSpeed Support Forums

LiteSpeed Support Forums (http://www.litespeedtech.com/support/forum/index.php)
-   PHP (http://www.litespeedtech.com/support/forum/forumdisplay.php?f=19)
-   -   Where Is Internal Redirect Example? (http://www.litespeedtech.com/support/forum/showthread.php?t=5422)

bledaone 10-26-2011 03:23 AM

Where Is Internal Redirect Example?
 
Hi. I'm using litespeed for some months and feel that the server is great. Howerver now I need it to be able to transfer large data (1 GB+) for download by user, but I don't know how.

Using php readfile is useless, always cut off in the middle of download. I've read about the litespeed's Internal Redirect but don't know how to put it into action. I've searched the forum & googled all day long, and can't find it either.

I've read this too : http://www.litespeedtech.com/support...ernal_redirect

But it doesn't solve my problem as I use php, not rubyonrails, and I can't find any usage example anywhere on the net.

Is there anyone who could give me some example?

Here is my code is you want to know, and it is not working at all :

header("X-LiteSpeed-Location: $file");
header("Content-type: application/force-download");
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
header("Content-Length: ". filesize($file));
readfile($file);

NiteWave 10-26-2011 04:39 AM

assume the file $DOC_ROOT/abc.dat, direct access URL is http://domain.com/abc.dat

the php code is just 1 line:
header("X-LiteSpeed-Location: /abc.dat");


All times are GMT -7. The time now is 06:02 AM.