fork download
  1. <?php
  2.  
  3. $namePath = '/reportxlsx/' . $this->params . '.xlsx';
  4.  
  5. $name = $this->params . '.xlsx';
  6.  
  7. header('Content-Description: File Transfer');
  8. header('Content-Type: application/octet-stream');
  9. header('Content-Disposition: attachment; filename=' . $name );
  10. header('Expires: 0');
  11. header('Cache-Control: must-revalidate');
  12. header('Pragma: public');
  13. header('Content-Length: ' . filesize($name));
  14. readfile($namePath);
Runtime error #stdin #stdout #stderr 0.01s 24304KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Fatal error:  Uncaught Error: Using $this when not in object context in /home/Y92vnn/prog.php:3
Stack trace:
#0 {main}
  thrown in /home/Y92vnn/prog.php on line 3