Hmmm, that's tricky. I really don't know how to get around this in
Cake, but you could always have cake call a stand alone script to
prepare the file for download. That way you won't have to worry about
cake already sending the headers. Maybe someone else can provide a
better answer.

On May 9, 2:55 am, acl68 <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I program a contract management software, where the contracts can be
> uploaded as pdf and later be viewd as a download.
>
> Since not everybody should be able to see every contract I don't want
> to store the pdfs in the files directory of the webroot, but in
> another directory not directly accessible via the web frontend (I
> chose a subdirectory of my application directory). Then I want to
> offer the pdf as a temporary download.
>
> Normally soemone would do it like this:
> header("Content-Type: x-type/subtype");
> header("Content-Length: ".filesize($file));
> header("Content-Disposition: attachment; filename=".$file);
>
> readfile($file);
>
> But of course with MVC in CakePHP I get the error messages:
> Warning: Cannot modify header information - headers already sent
> by....
>
> Does anyone have an idea how I can offer my file as a temporary
> download without getting the header trouble?
>
> Thank you in advance
>
> Anja
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to