As you know, certain file types are displayed in a browser when clicked on or opened, such as images, audio/video, pdf, etc. Sometimes you want to make these files available for download from a link instead of opening in the browser. This script will allow you to do that. It also hides the download location from your visitors so they will not be able to discover your directory layout. This is helpful if you find your site is being randomly searched by hackers or bots.
After extracting the dlhelper.php file, use a plain text editor and modify the value of the $dl_path variable. This value is relative to your site’s root directory. For example, if your download directory is (root)/mysite/downloads then the line would read:
$dl_path = "mysite/downloads";
After making the appropriate configuration change, upload the dlhelper.php file to the desired directory on your web site.
In SiteSpinner, you can execute the script using a link written as follows:
path-to-script/dlhelper.php?file=file-to-download

where path-to-script/ is the directory on your site where you uploaded the script (nothing if you used the root folder), and file-to-download is the file to be downloaded.
Contact the LowTechGeezer
VM User's Forum
Bruceee's Sandpit
Webmaster's Corner
Other Useful Sites
I have just tried this piece of code which works perfectly, although I do have one problem! I have it set up to download a .wmv file. If I choose the ‘save’ option there are no problems. If I choose the ‘open’ option it says it is saving it to a temporary file. When the save is complete Windows media player opens up as you would expect, but then says it cannot find the file. Can anyone tell me what is wrong?
Another minor point is that when I click on my text to prompt the download, it takes several seconds before the ‘Open or Save’ download box pops up, whereas if I am selecting a new page (non-cached) the response it almost instant. Where does the delay come from and is there anything which can be done?
Thanks,
Ascii.
Hi Larry,
Was just visiting this page to pass some information onto another forum member when I noticed there is a typo in your menu at left. “Sysem” instead of “System”.
Best regards,
Terry