Well, I tried using different code (from a newer message by Mukul
Sabharwal):

header("Content-length: $size");
header("Content-type: $type");

$fp = fopen($actualfile, 'rb') or print('Could not open file!');
$read = fread($fp, $size) or print('Could not read file');
print($read);

and this seems to work better, that is, files are download correctly.
However, there is a strange behavior, at least with IE5, which I don't know
if it's a bug on IE5 or not... When I click on a file, if I choose "save to
disk"  it works fine, but if I choose "Open from current location"  it
doesn't work. Anyone have any ideas on this?

--Matias


""Matias Pelenur"" <[EMAIL PROTECTED]> wrote in message
news:983od5$oc8$[EMAIL PROTECTED]...
> Hi,
> I'm trying to use readfile to send a file to the browser. The code I'm
using
> is:
>
> header("Content-length: $size");
> header("Content-type: $type");
> header("Content-disposition: attachment;filename=$filename");
> readfile($filename);
>
> It works fine for very small files, but for larger files it seems to send
> only the first 600 bytes and then hang... I tried with both IE and
Netscape
> and
> have the same problem.
>
> I'm using Apache 1.3.14 and PHP/4.0.4pl1 on Win2000 (using the PHP module
> for Apache)
>
> Any hints appreciated. Thanks!
> --Matias
>
> If you reply via email, please remove the -nospam- from the address.
>
>
>
>
>
> --
> 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]
>



-- 
PHP Windows 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]

Reply via email to