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();
    }

    
Home | Imprint | This part of the site doesn't use cookies.