Hi all,
I'm trying to force a file download, but something is wrong. I'm using
1.2 nightly (22.04.2008), and not using MediaView (I know...I'll
switch to it eventually;-)).
This is the relevant bit of my code:
$this->RequestHandler->respondAs($download['Download']['mime_type'],
array('attachment' => $download['Download']['display_file_name']));
$fp = fopen(FILES.$download['Download']['real_file_name'], 'rb');
fpassthru($fp);
fclose($fp);
$this->autoRender = false;
$this->layout = 'ajax';
And as you can see, if you go here
http://dsi.vozibrale.com/downloads/view/remember-me-component
and click the download button, the response header contains "Content-
Type: text/html" (according to Firebug) instead of the expected
"content disposition - attachment / file name" combo.
Am I using the RequestHandler::respondAs(...) in a wrong way?
Please not that this code works on my dev machine, this is why I'm
really confused.
Thanks in advance,
dr. H.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---