header("Content-Type: $mime");
header("Content-Disposition: attachment; filename="$file"");
header("Content-Length: ".filesize($filename));
if(strstr($mime, "text")){
$file_handle = @fopen("$filename","r");
}else{
$file_handle = @fopen("$filename","rb");
}
php 实现文本文件下载