Where Is Internal Redirect Example?

Discussion in 'PHP' started by bledaone, Oct 26, 2011.

  1. bledaone

    bledaone New Member

    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/wiki/doku.php?id=litespeed:wiki:feature:internal_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));
  2. NiteWave

    NiteWave Administrator

    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");

Share This Page