Download, don’t stream script
Sometimes you might want to put files on your server for people to download. The problem comes when the default action is to stream or execute the file.
For example you have a big video but most of your visitors will be on dial-up. If their browsers attempt to stream the video it will start & stop because their connections aren’t fast enough. Another example is if you want people to download a script but if people click the link to the script, the script gets executed not downloaded.
To solve these problems I wrote this simple php script. I wrote it so that there is no need to alter the script for different downloads, you just need to rename it and have one copy for each file you want your visitors to download.
How to use:
- First download the script by clicking here (yes I am using the script here) then
- Rename the script to the same name as the file to be downloaded plus a
.phpextension so if the file is calledbabyvideo1.mpg, rename the scriptbabyvideo1.mpg.php - Upload the file to the server, and upload the script to the same directory
- Put a link to the script, not to the file. Optionally tell your visitors to select download file when given a choice
- That’s it
Leave a comment below if this script is useful for you or if you have any problems with it


















Wow, I never knew these MIME headers before.
Seeing some related sites, it seems that
there are lots of useful headers, I haven’t used…
Thanks for your information.