<?php
/**
*Fil_download
*$path 要下载的文件路径
*$type 要下载的文件类型
*/
function Fil_download($path,$type = 'zip')
{
if(!file_exists($path))
{
return false;
}else{
$file = fopen($path,'r');
header('Content-Type: application/'.$type);
header('Content-disposition: attachment; filename='.basename($path));
header('Content-Length: '.filesize($path));
echo fread($file,filesize($file_dir));
fclose( $file );
exit ();
}
}
?>