note 29791 added to function.fpassthru
| From: | keyar_srinivasan at yahoo dot com | Date: | Tue, 25 Feb 2003 12:01:49 +0000 |
| Subject: | note 29791 added to function.fpassthru | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-44494@lists.php.net to get a copy of this message | ||
Hi
I am Creating a Txt File in Dynamic and Trying to Download it so that not to Display the Text in the
Browser. I have changed the Content Type and Pragma Settings but didnt get any Solution for that.
As it wont happens because the Default settings in the Browser accepts the Txt files and wont Force
to Download it. But If possible, if Any one have an Idea to do this Please Inform me
The Code is Give Below
$FileName = "fqif.txt";
$FileSize = filesize($FileName);
$FileType = filetype($FileName);
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
header("Content-type: application/download");
header("Content-Disposition:inline; filename=".$FileName);
header("location:".$FileName);
--
http://www.php.net/manual/en/function.fpassthru.php
http://master.php.net/manage/user-notes.php?action=edit+29791
http://master.php.net/manage/user-notes.php?action=delete+29791
http://master.php.net/manage/user-notes.php?action=reject+29791