21 private $disallowedContentTypes = [
32 protected function _processDownload(
$path, $resourceType)
35 $helper = $this->_objectManager->get(\
Magento\Downloadable\Helper\Download::class);
40 $contentType =
$helper->getContentType();
52 'must-revalidate, post-check=0, pre-check=0',
60 if ($fileSize =
$helper->getFileSize()) {
61 $response->setHeader(
'Content-Length', $fileSize);
64 $contentDisposition =
$helper->getContentDisposition();
65 if (!$contentDisposition || in_array($contentType, $this->disallowedContentTypes)) {
70 $response->setHeader(
'Content-Disposition', $contentDisposition .
'; filename=' .
$fileName);
85 return $this->_objectManager->get(\
Magento\Downloadable\Model\Link::class);
const DISPOSITION_ATTACHMENT