Hello,

I use a longblob field in MySQL to save PDF files. The upload seems to
work fine (files sizes and blob fields sizes match). However, I can't
figure how to display the pdf afterwards.

In my action, I do that:
********
$fichier = FichierPdfPeer::retrieveByPk($fichier_id);

$this->setLayout(false);
$this->getResponse()->clearHttpHeaders();

$this->getResponse()->setContentType('application/octet-
stream');
$this->getResponse()->setHttpHeader(
        "Content-Disposition",
        'inline; filename="'.$fichier->getNom().'.pdf"'
);
//$this->getResponse()->setHttpHeader("Content-Length", strlen
($fichier->getContenu()));

$this->renderText($fichier->getContenu());
return sfView::NONE;
******

The problem is that $fichier->getContenu() returns "Resource id #103"
and not the "contenu" field content so the file content is
"Resource...".

Cheers,

François
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" 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/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to