fork download
  1. <?php
  2.  
  3. $app->get('/download/{id}', function ($request, $response, $args) {
  4. $this->logger->info("Загрузка файла");
  5.  
  6. $file=$this->files_GW->getFile($args['id']);
  7.  
  8. $url=$this->settings['upload_folder'];
  9. $url.=$file->path;
  10. $url.=$file->name;
  11.  
  12. $response = $response->withHeader('Content-Disposition', 'attachment');
  13. $response = $response->withHeader('Location', $url);
  14. return $this->view->render($response, 'download.html', $args);
  15. })->setName('download');
Runtime error #stdin #stdout #stderr 0s 52488KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Notice:  Undefined variable: app in /home/rVR3KA/prog.php on line 3
PHP Fatal error:  Call to a member function get() on null in /home/rVR3KA/prog.php on line 3