wirtefile ($word_name,$data); } function wirtefile ($word_name,$data) { $path = 'public/uploads/'.$word_name; $file = fopen($path,"wd"); fwrite($file">
输入banner图图片脚本导航/分类

对word直接从数据库查询进行下载

<无详细内容>
  1. function save($word_name)
  2. {
  3. echo "";
  4. $data = ob_get_contents();
  5. ob_end_clean();
  6. $this->wirtefile ($word_name,$data);
  7. }
  8. function wirtefile ($word_name,$data)
  9. {
  10. $path = 'public/uploads/'.$word_name;
  11. $file = fopen($path,"wd");
  12. fwrite($file,$data);
  13. fclose($file);
  14. $file = fopen($path,"r");
  15. Header("Content-type: application/octet-stream");
  16. Header("Accept-Ranges: bytes");
  17. Header("Accept-Length: ".filesize($path));
  18. Header("Content-Disposition: attachment; filename=".basename($path));
  19. echo fread($file, filesize($path));
  20. fclose($file);
  21. unlink($path);
  22. $this->index();
  23. }