|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-07-20 15:42 UTC] johannes@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 18:00:01 2025 UTC |
Description: ------------ After executing a download process built with header() and print() can't get any further output to browser page. Reproduce code: --------------- <? $file = "my_file_to_dowload.txt"; header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: no-store"); header("Cache-Control: private",true); header("Content-Type: application/octet-stream"); header('Content-Disposition: attachment; filename="'.$file.'"' ); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".filesize($file)); readfile($file) echo("After I successfully downloaded the file, I can't see this line printed in browser window..."); ?> Expected result: ---------------- I expect that the code just after readfile($file) is being executed. In this case I wish to see in browser window the message sent with echo (). Actual result: -------------- Anything in php code which is after the block header("string"); ..... readfile("string"); is ignored. Exactly like the code was: header("string"); .... readfile("string"); exit();