This is my favorite PHP download script. I’ve used a different more simple method until a client wanted to be able to allow their site visitors to download a large file from a password protected directory. The PHP script works on Apache web servers for all kind of files. I have used this script for file downloads bigger than 500MB. The cache control header is used to force the download for text files and other files even if they are opened by default inside your web browser.