set_time_limit(0);
ini_set('memory_limit', '512M');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
ob_end_clean();
readfile($file);

主要注意前面2个设置(根据情况自己设置内存大小)和 ob_end_clean();函数的调用。

最新文章

  1. [转]HttpModule的认识
  2. Web3DGame之路,Babylonjs 和TypeScript学习笔记(二)
  3. C/C++函数调用的几种方式及函数名修饰规则以及c++为什么不允许重载仅返回类型不同的函数
  4. Noi2011 阿狸的打字机
  5. windows服务(installutil.exe)报错。异常来自 HRESULT:0x80131515
  6. java 15 -7 ListIterator 的特有方法
  7. 【WEB API项目实战干货系列】- API登录与身份验证(三)
  8. LightOJ1158 Anagram Division(状压DP)
  9. C++之STL之string
  10. Excel 操作类
  11. Visual Studio的常用快捷键
  12. Retrofit2.0 设置 连接超时
  13. Binary Tree Path Sum
  14. Fiddler: 如何抓取HTTPS协议的网页
  15. 3D点云数据分析:pointNet++论文分析及阅读笔记
  16. SAP 费用
  17. 用PLSQL Developer 查看连接因子 tnsnames.ora
  18. strus2 struts.xml详解
  19. LintCode 412: Candy
  20. python学习笔记011——检查变量类型type()

热门文章

  1. 恭喜您成为2014年度Microsoft MVP!
  2. spring mvc json的输入输出
  3. Redis学习(8)-redis持久化
  4. JS版的Server.UrlEncode
  5. 网站博客更换主机空间搬家:Discuz! X2.5老鹰主机搬家全过程
  6. Hadoop DistCp 使用指南
  7. 【js】appendChild
  8. Python学习笔记010——函数文档字符串
  9. OC 中new与alloc/init的差别
  10. Windwos配置Maven环境变量