note 25245 added to function.fpassthru
| From: | mikek at muonics dot nospam dot c dot o dot m | Date: | Mon, 16 Sep 2002 12:07:42 +0000 |
| Subject: | note 25245 added to function.fpassthru | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-36749@lists.php.net to get a copy of this message | ||
Replies to the above (10-Sep-2002 05:38 and 10-Sep-2002 06:17) anon posts:
10-Sep-2002 05:38 -- Using temporary redirects in the manner you describe only work if you have the
files in a location which are directly accessible by a regular HTTP request (temporarily or not).
This isn't an effective solution for me, because it is a specific requirement of my
implementation that certain files are accessible only through PHP: user permissions for downloading
files are handled via PHP and a user/license database instead of traditional .htaccess methods. In
the past (before PHP) I used CGI scripts to create temporary per-downloader symlinks to the files
and generated .htaccess files, along with htpasswd/group files, but it was a sloppy method because
the symlinks would linger (or be deleted prematurely), and wasn't conducive to online order
processing etc. This method (via fpassthru()) is much better: there is no direct access to any
file, by design.
10-Sep-2002 06:17 - My implementation does set the Content-Length header. It does not help. Some
browsers' download dialogs still linger for 15-30 seconds after the download is complete,
leading some users to think the download has stalled and to reinitiate it. In those browsers where
this has been a problem and I've tested it, the "Connection: close" header has worked
great. It's not abused: the download manager implementation is such that the header is sent
only for HTTP requests that directly result in the download occuring. It might be worthwhile
investigating whether or not there is a php hook into the server's watchdog timer so that it
can be set on a per-script basis and use that; but setting it to a low value globally seems just as
bad as sending "Connection: close" for every page would be.
--
http://www.php.net/manual/en/function.fpassthru.php
http://master.php.net/manage/user-notes.php?action=edit+25245
http://master.php.net/manage/user-notes.php?action=delete+25245
http://master.php.net/manage/user-notes.php?action=reject+25245