PHP: Code snippet
I found this on a page written in japanese. Great for streaming files through php and not reveling their source.
http://phpspot.org/blog/archives/2008/02/phpdlphp.html
This will also post the size of the file so you know how long it will take for it to download.
http://phpspot.org/blog/archives/2008/02/phpdlphp.html
header('Content-Type: application/octet-stream');
header('Content-Disposition: filename=dl.zip');
header('Content-Length: '.filesize('dl.zip'));
echo file_get_contents("dl.zip");
?>
This will also post the size of the file so you know how long it will take for it to download.


0 Comments:
Post a Comment
If you found this page useful, or you have any feedback, please leave a comment.
Links to this post:
Create a Link
<< Home