Re: Printing to a buffer
| From: | Todd Cary | Date: | Sun, 13 Nov 2005 22:34:10 +0000 |
| Subject: | Re: Printing to a buffer | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.general php.general |
| Request: | Send a blank email to php-general+get-225703@lists.php.net to get a copy of this message | ||
Just before the police knocked at my door, I made a few changes!
<?
ob_start();
print "This is a test<br>";
$buf = ob_get_contents();
$len = strlen($buf);
ob_end_clean();
header("Content-type: text/plain");
header("Content-Length: $len");
header("Content-Disposition: attachment; filename=sfyc.html");
print($buf);
?>
Todd
Marcus Bointon wrote:
On 13 Nov 2005, at 19:27, Jasper Bryant-Greene wrote:I think he is. I've called the MIME-type police and they'll be round later. Todd, I think you should read this: http://support.microsoft.com/kb/ q260519/ There's a PHP example just before the user notes here: http:// www.php.net/header MarcusMany thanks! I did not know that MIME-Type. Change duly made!You're not suggesting that you actually set the MIME-Type to application/force-download, are you?