note 15656 added to function.header

From: Date: Tue, 25 Sep 2001 13:15:40 +0000
Subject: note 15656 added to function.header
Groups: php.notes 
Request: Send a blank email to php-notes+get-18277@lists.php.net to get a copy of this message
If I open url "download" in new window - that's all right with right downloading. But I need to download "manual.log" without loading new window - unfortunately in this case the following code return me the page with it,but not the attachment "manual.log" that I want. P.S. It is important that user get "manual.log" with another name - "yo.txt" if ($file) { header ("Content-Type: application/octet-stream"); header ( "Content-Length: ".filesize("manual.log")); header ( "Content-Disposition: attachment; filename=yo.txt"); readfile("manual.log"); exit(); } elseif ($id) { echo "<a href=$PHP_SELF?file=$id>download</a>"; } -- http://www.php.net/manual/en/function.header.php http://master.php.net/manage/user-notes.php?action=edit+15656 http://master.php.net/manage/user-notes.php?action=delete+15656 http://master.php.net/manage/user-notes.php?action=reject+15656

« previous php.notes (#18277) next »