Jump to content

php header to cause a download


Recommended Posts

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
Link to comment
Share on other sites

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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.