Jump to content


Photo

php header to cause a download


  • Please log in to reply
1 reply to this topic

#1 phporcaffeine

phporcaffeine
  • Members
  • PipPipPip
  • Advanced Member
  • 361 posts
  • LocationOhio, USA

Posted 09 May 2006 - 07:09 PM

I have a script that takes query data and dynamically formats it into " .rtf " syntax.

Currently what I have been doing is just fwrite() 'ing a file to disk then allowing the user to download the file. What I want to do is just send some custom " content-type: " headers to the browser and cause a download.

Even after reading the manual I can't get it right. Anyone know how to do it?

P.S ( I would be streaming an "application/msword" mime)


TIA
Thanks,

Ryan Huff
President & Founder, MyCodeTree
support@mycodetree.com | http://mycodetree.com

#2 haydndup

haydndup
  • Members
  • PipPipPip
  • Advanced Member
  • 42 posts
  • LocationJohannesburg, South Africa

Posted 09 May 2006 - 07:43 PM

Have a look here. It might help. Just scroll down to the section about downloading files. Not sure if its much help. [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=31047&st=15&p=157705&#entry157705\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?...05&#entry157705[/a]
[!--coloro:#660000--][span style="color:#660000"][!--/coloro--]The Gene Pool Could Use A Little Chlorine[!--colorc--][/span][!--/colorc--]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users