浙林龙哥

   :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

<?php

header('Content-Type: application/octet-stream');
$filesize = filesize('s.png'); //获得文件大小
header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: pre-check=0, post-check=0, max-age=0');
header('Content-Transfer-Encoding: binary');
header('Content-Encoding: none');
header('Content-type: application/force-download');
header('Content-length: '.$filesize);
header('Content-Disposition: attachment; filename="s.png"');
readfile('s.png');

?>

posted on 2010-03-10 12:41  浙林龙哥  阅读(1316)  评论(0编辑  收藏  举报