630 likes | 717 Views
<?php. function send_file($xitem) {. ob_end_clean();. $path = '../media/'.$xitem;. if (!is_file($path) or connection_status()!=0) return(FALSE);. header("Cache-Control: no-store, no-cache, must-revalidate");. // header("Cache-Control: post-check=0, pre-check=0", false);.
E N D
if (!is_file($path) or connection_status()!=0) return(FALSE);
header("Cache-Control: no-store, no-cache, must-revalidate");
// header("Cache-Control: post-check=0, pre-check=0", false);
// header("Expires: ".gmdate("D, d M Y H:i:s", mktime(date("H")+2, date("i"), date("s"), date("m"), date("d"), date("Y")))." GMT");
// header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
$file_extension = strtolower(substr(strrchr($path,"."),1));
case "exe": $ctype="application/octet-stream"; break;
case "xls": $ctype="application/vnd.ms-excel"; break;
case "ppt": $ctype="application/vnd.ms-powerpoint"; break; • case "pps": $ctype="application/vnd.ms-powerpoint"; break;
case "avi": $ctype="video/x-msvideo"; break; • case "php":
$header='Content-Disposition: attachment; filename="'.$filename.'";';