Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setContentTypeByMimeType example
return
$this
;
}
/** * set header for file download. * * @return void */
public
function
buildHeaders
(
)
{
if
(
!
$this
->
hasHeader
(
'Content-Type'
)
)
{
$this
->
setContentTypeByMimeType
(
)
;
}
if
(
!
$this
->
hasHeader
(
'Content-Disposition'
)
)
{
$this
->
setHeader
(
'Content-Disposition',
$this
->
getContentDisposition
(
)
)
;
}
$this
->
setHeader
(
'Expires-Disposition', '0'
)
;
$this
->
setHeader
(
'Content-Transfer-Encoding', 'binary'
)
;
$this
->
setHeader
(
'Content-Length',
(string)
$this
->
getContentLength
(
)
)
;
$this
->
noCache
(
)
;
}