diff --git a/plugins/bc-uploader/src/Controller/UploaderFilesController.php b/plugins/bc-uploader/src/Controller/UploaderFilesController.php index 65c4394904..7c56970fea 100755 --- a/plugins/bc-uploader/src/Controller/UploaderFilesController.php +++ b/plugins/bc-uploader/src/Controller/UploaderFilesController.php @@ -17,6 +17,7 @@ use BaserCore\Annotation\NoTodo; use BaserCore\Annotation\Checked; use BaserCore\Annotation\UnitTest; +use Laminas\Diactoros\Stream; /** * ファイルアップローダーコントローラー @@ -93,9 +94,12 @@ public function view_limited_file(UploaderFilesServiceInterface $service, string "asf" => "video/x-ms-asf", "wmv" => "video/x-ms-wmv" ]; - header("Content-type: " . $contentsMaping[$ext]); - readfile(WWW_ROOT . 'files' . DS . 'uploads' . DS . 'limited' . DS . $filename); - exit(); + $this->setResponse( + $this->getResponse() + ->withHeader('Content-type', $contentsMaping[$ext]) + ->withBody(new Stream(WWW_ROOT . 'files' . DS . 'uploads' . DS . 'limited' . DS . $filename)) + ); + $this->disableAutoRender(); } else { $this->notFound(); }