include("class.php");
date_default_timezone_set("PRC");//设置时区为中国
$filetype_array = array("as"=>"Flash ActionScript File","bmp"=>"BMP图像"
,"doc"=>"Microsoft Word文档","rar"=>"WinRAR 压缩文档",
"ppt"=>"Microsoft PowerPoint 演示文稿","txt"=>"文本文档",
"xls"=>"Microsoft Excel 工作表","gif"=>"GIF图像",
"jpg"=>"JPEG图像","jpeg"=>"JPEG图像","png"=>"PNG图像",
"html"=>"HTML Document","htm"=>"HTML Document",
"mp3"=>"MP3 格式声音","chm"=>"已编译的HTML帮助文件",
"fla"=>"Flash Document","mdb"=>"Microsoft Access 应用程序",
"pdf"=>"PDF 文件","swf"=>"Flash Movie","xml"=>"XML 文档",
"zip"=>"WinRAR ZIP 压缩文件","asf"=>"Windows 音频/视频文件",
"wmv"=>"Windows Media 音频/视频文件","avi"=>"视频剪辑",
"mpeg"=>"电影剪辑","exe"=>"应用程序","gz"=>"WinRAR 压缩文件",
"tar"=>"WinRAR 压缩文件","tiff"=>"TIFF 文件");
//以上为判断函数
$bai="./images";
$nba=opendir($bai);
$i=1;
echo "
for ($i=1;$i <=$page;$i++){ $i==$cur_page ? $a= " ".$i. " " : $a= " ".$i. " "; echo "$a "; } ?> |
上面的代码有问题。
试试这个代码:
$get_url = "x.zip";
ob_end_clean();
header("Content-Type: application/force-download");
header("Content-Transfer-Encoding: binary");
header('Content-Type: application/zip');
header('Content-Disposition: attachment; filename='.'123_'.$get_url);
header('Content-Length: '.filesize($get_url));
error_reporting(0);
readfile($get_url);
flush();
ob_flush();
exit;
?>
我稍微修改了 一点儿,就可以正常下载。
你这个是IE下载设置的问题,不是程序的问题,设置IE就可以解决了