[development] How do I send a file to the user?

Johan Forngren johan at forngren.com
Thu Feb 1 08:13:10 UTC 2007


I might be wrong on this one, but I've always been told to never use die()
in Drupal, since it stops code from the footer to be run. I recommend you to
use  <http://api.drupal.org/api/5/function/drupal_set_header>
http://api.drupal.org/api/5/function/drupal_set_header to override drupal's
headers.

OT: Should we write a patch to remove that die()-call?

On 2/1/07, Ernst Plüss <ernst.pluess at gmail.com> wrote:
>
> Having a closer look at
> http://api.drupal.org/api/5/function/_locale_export_po showed gave me
> the solution.
>
> A die(); after sending out headers and excel data did the job. I don't
> know exactly why this is needed, my guess is that if it's missing
> somehow the next time a header is sent php thinks it belongs to the
> same response and complains because already non header data has been
> sent.
>
> Thanks a lot for your assistance!
> Ernst
>



-- 
Regards,
  Johan Forngren

  johan at forngren.com :: http://johan.forngren.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20070201/75496a5c/attachment.htm 


More information about the development mailing list