controllers/DownloadController.php
/**
     * Send HTTP headers with appropriate information for file download
     * 
     * @param string $fileName
     * @param string $fileContents
     */
Send HTTP headers with appropriate information for file download

@param string $fileName
@param string $fileContents
Send HTTP headers with appropriate information for file download @param string $fileName @param string $fileContents
private function sendDownloadHeaders($fileName, $fileContents) {
        header("Pragma: public", true);
        header("Expires: 0"); 
        header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
        header("Content-Type: application/force-download");
        header("Content-Type: application/octet-stream");
        header("Content-Type: application/download");
        header("Content-Disposition: attachment; filename=".$fileName);
        header("Content-Transfer-Encoding: binary");
        header("Content-Length: ".strlen($fileContents));
    }
private function sendDownloadHeaders ( $ fileName , $ fileContents ) { header ( " Pragma: public " , true ) ; header ( " Expires: 0 " ) ; header ( " Cache-Control: must-revalidate, post-check=0, pre-check=0 " ) ; header ( " Content-Type: application/force-download " ) ; header ( " Content-Type: application/octet-stream " ) ; header ( " Content-Type: application/download " ) ; header ( " Content-Disposition: attachment; filename= " . $ fileName ) ; header ( " Content-Transfer-Encoding: binary " ) ; header ( " Content-Length:  " . strlen ( $ fileContents ) ) ; }
Send HTTP headers with appropriate information for file download
Send HTTP headers with appropriate information for file download
// set expiration time