zfilecontent.php 1005 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * The file entry point for yueku.
  4. *
  5. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
  6. * @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  7. * @author Chunsheng Wang <chunsheng@cnezsoft.com>
  8. * @package entries
  9. * @version 1
  10. * @link https://www.zentao.net
  11. */
  12. class zfileContentEntry extends entry
  13. {
  14. /**
  15. * GET method.
  16. *
  17. * @param string $fileID
  18. * @access public
  19. * @return string
  20. */
  21. public function get($fileID)
  22. {
  23. ob_end_clean();
  24. helper::header('Content-type', 'application/octet-stream');
  25. helper::header('Content-Transfer-Encoding', 'binary');
  26. helper::header('Accept-Ranges', 'bytes');
  27. // helper::header('Content-Length', filesize($filePath));
  28. helper::header('Content-Disposition', 'attachment; filename="hello.txt"');
  29. echo 'hello';
  30. }
  31. }