怎样用php实现文件下载? http://www.csdn.net/Expert/TopicView1.asp?id=984656http://www.csdn.net/Expert/TopicView1.asp?id=984826 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 function send($filename=''){ if($filename == ''){ $filename = strftime("%d%b%Y"); } $fd = fopen( $filename, "r" ); $download_body = fread($fd, filesize($filename)); fclose( $fd ); $type = 'application/octet-stream'; header("Content-Type: $type"); header("Content-Disposition: attachment; filename=$filename"); echo($body);} 如何用php计算一年中或者一段日期之内每个星期六的日期? apache2.2+mysql+php5 的郁闷问题,解决后立即给分,不够在加 妈妈的!!高手们,帮忙了 数组算法 大家都用哪些快捷键? 我一个新手看PHP手册,里面有几个概念性的问题想请教大家 对PHP一窍不通如何学起。。。 哪位大哥能提供一个比较精典的php与perl相兼容的教程 难道yorgo也是成电的?zxyufan请回答,看来就我算是大龄青年了:( (ipman) Phpunit DOS下运行报错 求大侠帮忙 请问这个出错是怎么回事?100分相送 这一段是什么意思?
if($filename == ''){
$filename = strftime("%d%b%Y");
}
$fd = fopen( $filename, "r" );
$download_body = fread($fd, filesize($filename));
fclose( $fd );
$type = 'application/octet-stream';
header("Content-Type: $type");
header("Content-Disposition: attachment; filename=$filename");
echo($body);
}