コード例 #1
0
ファイル: FileController.php プロジェクト: karwana/penelope
 public function read($system_path)
 {
     if (!is_readable($system_path)) {
         $this->app->notFound(new Exceptions\Exception('The requested file is unreadable or does not exist at "' . $system_path . '".'));
         return;
     }
     $response = $this->app->response;
     $response->headers->set('Content-Type', File::getMimeType($system_path));
     $response->headers->set('Content-Length', filesize($system_path));
     readfile($system_path);
 }