43 $filepath = $this->getFilePath(
$options);
46 throw new \InvalidArgumentException(
"File '{$filepath}' does not exists.");
49 $mimeType = $this->mime->getMimeType($filepath);
51 $this->response->setHeaders(
$options[
'headers']);
53 $this->response->setHeader(
'Content-length',
filesize($filepath));
54 $this->response->setHeader(
'Content-Type', $mimeType);
56 $this->response->sendHeaders();
60 while (($buffer = fgets(
$handle, 4096)) !==
false) {
64 throw new \UnexpectedValueException(
"Unexpected end of file");
79 private function getFilePath(
$options): string
86 throw new \InvalidArgumentException(
"Filename is not set.");
__construct(\Magento\Framework\HTTP\PhpEnvironment\Response $response, \Magento\Framework\File\Mime $mime)
elseif(isset( $params[ 'redirect_parent']))