On Wednesday, January 31, 2001 at 12:00 PM, "Boaz Yahav"
<[EMAIL PROTECTED]> wrote:
> Seems like your theory doesn't stand the reality test :)
>
> This is the script which for some reason works with Netscape but not with
IE
> (it used to) :
> ignore_user_abort(0);
> $filename="test.gz";
> $file="/home/examples/" . $filename;
> header("Content-Disposition: attachment; filename=$filename");
> header("Content-Type: application/x-gzip");
> header("Content-Length: ".filesize($file));
> header("Pragma: no-cache");
> header("Expires: 0");
/*
> $fp = fopen($file, "r");
> if(!$fp) {
> echo"Can't open file for read";
> exit();
> }
> print fread($fp, filesize($file));
*/ // readfile($file) does the same thing.
> echo"<BR><BR><BR><BR><H1><B>The file was downloaded
> successfully</B></H1><BR><BR><BR><BR>";
>
> For some reason it never shows the last echo weather i let the DL complete
> or stop it
> in the middle...
>
Remember that everything you are sending to the browser -- whether it be by
print, echo, readfile, or HTML code outside of <?PHP ... ?>, becomes the
file the user is downloading. If you were to open the gzip file you're
sending, you'd notice that the "<BR><BR><BR><BR><H1><B>The file was
downloaded</B> successfully</B></H1><BR><BR><BR><BR>" is being appended to
the end of that file.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]