#13601 [Com]: File download with Content-Length specified fails with IE5.5

From: Date: Fri, 18 Oct 2002 18:08:20 +0000
Subject: #13601 [Com]: File download with Content-Length specified fails with IE5.5
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-22785@lists.php.net to get a copy of this message
 ID:               13601
 Comment by:       tlepkowski@comcast.net
 Reported By:      adam@net-europa.com
 Status:           Closed
 Bug Type:         Apache related
 Operating System: Linux (Red Hat 7)
 PHP Version:      4.0.6
 New Comment:

Here is your code, altered slightly

$userfile = "file.xls";

$size = filesize($userfile);
$fp=fopen($userfile,"r");

header("Pragma: no-cache");// HTTP/1.0
header("Cache-Control: no-cache, must-revalidate");// HTTP/1.1
header("Content-Type: application/octet-stream");
if(preg_match("/MSIE 5.5/", $HTTP_USER_AGENT)) {
        $header = "Content-Disposition: filename=".$userfile;
        //header("Content-Disposition: filename=$userfile");
}else {
        $header = "Content-Disposition: attachment;
filename=".$userfile;
        //header("Content-Disposition: attachment;
filename=$userfile");
}

header($header);
$header_str = "Content-Length: ".$size;
header($header_str);
header("Content-Transfer-Encoding: binary\n");
fpassthru($fp);


Hope this works.


Previous Comments:
------------------------------------------------------------------------

[2001-11-22 02:46:57] adam@net-europa.com


Not tham I am specifically aware of, but it is highly possible that my
ISP (BT Internet) has some kind of proxy.

Incidentally, I have tried a couple of different ISPs with the same
result.

I would guess that this IS a proxying-related issue.

------------------------------------------------------------------------

[2001-11-21 12:25:12] sniper@php.net

Are you sure there isn't some transparent proxy involved?


------------------------------------------------------------------------

[2001-11-20 06:55:25] adam@net-europa.com

As stated in my original submission, EITHER going through a proxy, OR
simply dialling up through an ISP, you get the problem.

Connecting directly over a LAN, you do not.

Please re-open.

------------------------------------------------------------------------

[2001-11-14 06:41:49] sander@php.net

No feedback. Closing.

------------------------------------------------------------------------

[2001-10-23 06:23:12] sniper@php.net

I would guess this has something to do with proxy being 
in between..is there one?

--Jani


------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/13601

-- 
Edit this bug report at http://bugs.php.net/?id=13601&edit=1



Thread (1 message)

  • tlepkowski at comcast dot net
  • Unknown Message
    • tlepkowski at comcast dot net
« previous php.bugs (#22785) next »