- Joined
- Nov 28, 2004
- Messages
- 2,236
- Reaction score
- 0
I am stuck.
I am making a file download relay/proxy/tunnel/whatever script. I need a script which relays download through server running this php script.
Basically I am doing something like:
Well, that is not working... I got some more examples with "header" functions, but that does not seem to be working..
SO, could anyone help me by giving the correct header syntax (or maybe there is something else that could be used down here..?). It would be nice that the script would show the correct download filename and file lenght to know how much it is left to download the file.
I also had tried to use "file_get_contents" and "file" and then I just echo the file being in that var, but this is not a good thing to do, because the file can be 1GB+ and I don't really want to load such stuff into the memory...
Thanks for showing me the right way... I DO HOPE ANYONE RESPONDS!
TY
I am making a file download relay/proxy/tunnel/whatever script. I need a script which relays download through server running this php script.
Basically I am doing something like:
PHP:
$theFile = 'http://www.porno.com/downloads/alotpr0n.zip';
header ("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header ("Content-Type: application/octet-stream");
header ("Content-Length: " . filesize($theFile));
header ("Content-Disposition: attachment;");
readfile($theFile);
SO, could anyone help me by giving the correct header syntax (or maybe there is something else that could be used down here..?). It would be nice that the script would show the correct download filename and file lenght to know how much it is left to download the file.
I also had tried to use "file_get_contents" and "file" and then I just echo the file being in that var, but this is not a good thing to do, because the file can be 1GB+ and I don't really want to load such stuff into the memory...
Thanks for showing me the right way... I DO HOPE ANYONE RESPONDS!
TY