[PHP] Can I do this? header(Content-type: text/rtf);

2003-02-20 Thread John Taylor-Johnston
Hey,

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?

John


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




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

2003-02-20 Thread David Otton
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.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




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

2003-02-20 Thread David Otton
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);

Sorry, I should have mentioned

header(Content-Disposition: attachment; filename=myfile.rtf);

as well. Rather easier :)


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




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

2003-02-20 Thread John Taylor-Johnston
Works great. Thanks,
John


 I'm using PHP  MySQL to generate a RTF document. I use this header:
 header(Content-type: text/rtf);
 header(Content-Disposition: attachment; filename=myfile.rtf);

--
John Taylor-Johnston
-
If it's not open-source, it's Murphy's Law.

Université de Sherbrooke:
http://compcanlit.ca/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php