admin 管理员组

文章数量: 1086019

$sava_name = '/uploadfile/2014/0726/20140726114913835.txt';
header("Content-Type: application/force-download");
header("Content-Transfer-Encoding: binary");
header('Content-Type: text/plain');
header('Content-Disposition: attachment; filename='.$sava_name);

readfile($sava_name);



case "jpg":
		case "jpeg": $ctype="image/jpeg"; break;
		case "pdf": $ctype="application/pdf"; break;		
		case "gif": $ctype="image/gif"; break;	
		case "png": $ctype="image/png"; break;
		case "doc": $ctype="application/msword"; break;	
		case "zip":	$ctype="application/zip";break;	
		case "rar":	$ctype="application/rar";	break;	
		case "mp3":	$ctype="audio/mpeg3";	break;	
		case "avi":	$ctype="video/avi";	break;	
		case "doc":	$ctype="application/msword";break;	
		case "xls":	$ctype="application/vnd.ms-excel";	break;		
		case "wav":	$ctype="audio/wav";	break;	
		case "html":
		case "htm": $ctype="text/html";	break;	
		case "txt":	$ctype="text/plain";	break;
		case "flv":	$ctype="flv-application/octet-stream";	break;
		case "mp4":	$ctype="video/mp4";	break;		  
		default: $ctype="application/force-download"; //$ctype="application/octet-stream";

本文标签: 打开下载 不直接 浏览器 程序 txt