首页 > php代码 > php 实现文本文件下载

php 实现文本文件下载

<?php
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 实现文本文件下载


本文地址:http://www.phprm.com/code/3d7f20028aa41aaae6e57866c81043cf.html

转载随意,但请附上文章地址:-)

标签:none

发表留言