Hi Friends,

We are trying to download a file in Symfony 1.0 action...

But it just returns the content as text in the HTTP response and the
file-save dialog of the browser doesn't appear at all... :(

Here is the snippet from action. It tries to send a couple of words as
a PDF file -

$filename="ravi.pdf";

$this->getResponse()->setHttpHeader('Pragma', 'public');

$this->getResponse()->setHttpHeader("Content-Description","File
Transfer");

$this->getResponse()->setContentType('application/pdf',TRUE);

$this->getResponse()->setHttpHeader('content-transfer-encoding',
'binary', TRUE);

$this->getResponse()->setHttpHeader("Content-Disposition","attachment;
filename=\"".$filename."\"", TRUE);

$this->getResponse()->sendHttpHeaders();

$this->getResponse()->setContent("sample content");

return sfView::NONE;


What's the issue with the code?

Thanks a lot for reading... :)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to