note 47937 added to function.fpassthru
| From: | webmaster at hardcorehoneyz dot com | Date: | Mon, 06 Dec 2004 13:33:12 +0000 |
| Subject: | note 47937 added to function.fpassthru | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-81440@lists.php.net to get a copy of this message | ||
I believe the following problem is a result of using sessions and fpassthru together.
I have a subscription based site which protects large video files (WMV format between 100-120MB) by
storing them beneath web root. Downloading a video file requires the user to click a HTML link which
requests a PHP script e.g. download-video.php?video_id=123. If the user is valid (session vars
created from sucessful login) the script then creates the necessary headers to trigger a 'Save
As' download box, opens the file from beneath web root and sends it using fpassthru.
The problem is as follows:
The user should be able to click other links on the site whilst a file is downloading. But when they
do so, the requested page won't load until the download is complete.
As this download script is a seperate PHP request, the user should be able to load other pages on
the site whilst the file is downloading.
At time of writing, I've tried almost everything to remove this bug. There must be a problem
with using a PHP script rather than a direct web server link to download files.
----
Manual Page -- http://www.php.net/manual/en/function.fpassthru.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+47937
Delete -- http://master.php.net/manage/user-notes.php?action=delete+47937&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47937&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47937&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47937&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47937&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47937&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+47937&report=yes
Search -- http://master.php.net/manage/user-notes.php