Skip to content

Commit

Permalink
UploaderFilesController::view_limited_file から exit() を削除
Browse files Browse the repository at this point in the history
テストができないため
  • Loading branch information
ryuring committed Aug 20, 2024
1 parent 79e3b07 commit 5253af1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions plugins/bc-uploader/src/Controller/UploaderFilesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use BaserCore\Annotation\NoTodo;
use BaserCore\Annotation\Checked;
use BaserCore\Annotation\UnitTest;
use Laminas\Diactoros\Stream;

/**
* ファイルアップローダーコントローラー
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 5253af1

Please sign in to comment.