I have the following:
if ( $extension == 'xls' ){
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=\"$excel_filename
\"");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
header("Pragma: public");
echo $excel_file_data;
}
@flush();
@ob_end_flush();
exit();
On Oct 2, 9:57 pm, bingo <[EMAIL PROTECTED]> wrote:
> hi,
>
> In my view, there is an option to download data in a xml format. The
> user clicks on the submits a form and a controller method is executed.
> The controller calls a file utility (in the vendor folder) that sets
> the header and sets the file content for download and at the script
> calls die(); Although everything seems to be right, I am not able
> force download. When the user clicks on the download link, the browser
> goes to the controller url and then just dies out.
>
> Can anyone shed a light on how to force download in CakePHP. i assume
> I am messing up with header content
>
> Regards,
> Ritesh
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---