关于php中filesize的一个奇怪的现象,求解答。 本帖最后由 abcfyk 于 2012-06-04 02:29:00 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Example #1 Forcing a download using readfile()<?php$file = 'monkey.gif';if (file_exists($file)) { header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename='.basename($file)); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate'); header('Pragma: public'); header('Content-Length: ' . filesize($file)); ob_clean(); flush(); readfile($file); exit;}?> header跳转和file_get_contents,哪种速度快些? 关于 RewriteCond 指令 301重定向问题 让Dreamweaver支持PHP函数跳到定义处的插件 正则表达式 上传图片的问题 PHP注释? 想使用session遇到的一个问题 谁能提供一段,通过网页上传文件的源代码? dll文件的路径问题 向高手求救!! 求教!php的SoapClient问题,webservice的地址从ip地址改为域名后报错了 php如何统计下载次数?
Example #1 Forcing a download using readfile()<?php
$file = 'monkey.gif';if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
ob_clean();
flush();
readfile($file);
exit;
}
?>