LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > PHP > Where Is Internal Redirect Example?

Reply
 
Thread Tools Display Modes
  #1  
Old 10-26-2011, 03:23 AM
bledaone bledaone is offline
New Member
 
Join Date: Oct 2011
Posts: 1
Default 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);
Reply With Quote
  #2  
Old 10-26-2011, 04:39 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,217
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");
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 12:15 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.