txt pdf 等浏览器不直接打开下载程序

$sava_nameuploadfile2014072620140726114913835.txt; header("Content-Type: applicationforce-download"); h

$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";

发布者:admin,转转请注明出处:http://www.yc00.com/web/1743815700a4511851.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信