The following bit of code should cause most browsers to pop up a file download dialog box.<br><br>
To use it, place it in a script then put a link on your webpage pointing to it:
Code:
<?php
$filename = "name of the file to download";
$filepath = "path/where/file/is/on/server/";
header("Content-type: application/octetstream");
header("Content-Disposition: attachment; filename=$filename");
readfile("$filepath$filename");
exit();
?>
Note: There should be no blank lines or html outside the php for this script.
|