download.php **
<?
$download_folder_path = "/your_file_folder/";
// get the file name from the database by searching with the id
$the_file = $file_name_from_the database;
$file = $download_folder_path.$the_file;
if (strstr($HTTP_USER_AGENT,"MSIE")){
header ( "Content-Disposition: filename=$the_file");
}
else
{
header ( "Content-Type: application/x-zip-compressed");
// change header Content Type To match the type of file, the example is for a zip file
header ( "Content-Disposition: filename=$the_file");
}
readfile($file);
?>