Hi!
I have a PHP page "transfer.p hp" and a MySQL db. The client should
download binary files by "http://.... /transfer.php?ID =xx", where the
ID is searched in the db and the real URI is read.
In the transfer.php the "Content-Encoding" and the
"Content-Disposition" header fields are set. Then I do a fpassthru() or
a readfile(), for example: readfile
("http://www.someserver. com/somefile.zip").
This works fine - theoretically.. . The problem is, that it takes a long
time befor the download dialog appears in the browser. I tried
readfile, I tried fpassthru, I tried "fopen ('http://...')" with an
"until feof"-loop. The script or the server first downloads the whole
file from the URL, and then passes the output buffer to the client :-(
Ah, I also tried ob_flush() and flush() ... no gain :-(
Is there a way to send the file data to the client while reading the
URL? I use PHP 4.3.7 and the CGI Gateway (Xitami in my test
environment).
I have a PHP page "transfer.p hp" and a MySQL db. The client should
download binary files by "http://.... /transfer.php?ID =xx", where the
ID is searched in the db and the real URI is read.
In the transfer.php the "Content-Encoding" and the
"Content-Disposition" header fields are set. Then I do a fpassthru() or
a readfile(), for example: readfile
("http://www.someserver. com/somefile.zip").
This works fine - theoretically.. . The problem is, that it takes a long
time befor the download dialog appears in the browser. I tried
readfile, I tried fpassthru, I tried "fopen ('http://...')" with an
"until feof"-loop. The script or the server first downloads the whole
file from the URL, and then passes the output buffer to the client :-(
Ah, I also tried ob_flush() and flush() ... no gain :-(
Is there a way to send the file data to the client while reading the
URL? I use PHP 4.3.7 and the CGI Gateway (Xitami in my test
environment).
Comment