如何在执行 php 脚本之前将标头发送到客户端?
我的脚本需要很长时间才能完成,而客户在此期间没有收到任何东西。
<?
header("HTTP/1.1 200 OK");
header("Date: Thu, 23 Jun 2011 10:16:31 GMT");
header("Content-Type: application/octet-stream");
header("Content-Length: 12275768");
header("Accept-Ranges: bytes");
header('Content-Disposition: attachment; filename="Untitled-1.bmp"');
header("Content-Transfer-Encoding: binary");
header("Connection: close");
//Send headers now
//because my php script take many time to finish
//because it downloads a file from a remote server
.
.
.
?>