Re: Can I do this? header("Content-type: text/rtf");

From: Date: Thu, 20 Feb 2003 13:40:53 +0000
Subject: Re: Can I do this? header("Content-type: text/rtf");
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-136346@lists.php.net to get a copy of this message
On Thu, 20 Feb 2003 03:42:14 -0500, you wrote: >I'm using PHP & MySQL to generate a RTF document. I use this header: > >header("Content-type: text/rtf"); > >Of course, the header scares the poor browser. The browser bawks and says, unknown file type, >and instructs the browser to save the file. > >It tries to save a file called "export_to_rtf_text_format.php" > >The folks I work with are technologically challenged. Asking them to save that document and >rename it to *.rtf may be disasterous. > >Come on, we all work with a couple technologically challenged people :) I like mine so I try to >make their life easier! > >Sooo ... can I change the header somehow to instruct it to save a file called >"export_to_rtf_text_format.rtf" instead? If this is an intranet (ie you know everyone's on the same platform), then header("Content-type: application/msword"); will encourage the file to open in Word (which is where you probably wanted it anyway). If this is the only rtf file on your webserver, you could set it up so *.rtf files get run under PHP just as *.php files do, then rename your file to *.rtf Again on an intranet, fix everyone's browsers so they handle text/rtf correctly.

« previous php.general (#136346) next »