I have posted the following message to php-windows but i got no answer.

I am using IIs 5 on windows 2k sp2 with php 4.1.1.
There is a problem with the sctipt that follows and MSIE versions 5 to 6.

A script sends a jpeg image to the client. It goes like this:

$imgsrc = 'full path of the image file';
header ("Content-type: some/image");
header ("Content-disposition: attachment; filename=myimage.jpg");
header ("Content-length: ".filesize($imgsrc) );

$fp = fopen( $imgsrc, "rb" );
if (!$fp) {
    ..... Log the error .....

fpassthru ($fp);


It works fine if the user desides to save or open the image.
But if the user cancels the download, Internet Explorer stops
receiving anything from the site. Any click on a link hangs
(IE displays in the status bar "Web site found. Waiting for reply")
Links to static html files on my web server work
and you can also browse any other sites, but nothing on my site that is
parsed by php works.

After some attemts (clicks and reloads), IIs reports the following message:
"HTTP 403.9 - Access Forbidden: Too many users are connected
Internet Information Services"
Increasing the user limit on IIS, just requires a few more atemts to show
this message.
After I close all IE instances or restart IIS, everything works fine again.

I have tried ignore_user_abort(1), sending expire headers, readfile()
instead of
fpassthru() etc but the problem persists.
Nothing changes with older versions of php or IE.

This problem does not happen when using Netscape (any version)
or download managers.
Similar script written in perl does not have the same problem.

Please help. It is a very-very late to switch to another scripting language
for this project (even using perl or asp for the download part requires a
deal of work).

John Chronakis

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to