GunsNRoses Posted March 19, 2008 Share Posted March 19, 2008 Hello, there. Nice site. I'm using a php script which serves a movie file to a player embeded in an html page. Within the script I use the following headers: $fName = 'test.flv'; $fSize = filesize($fName); header('Content-Description: File Transfer'); header ("Content-transfer-encoding: binary"); header ("Content-Type: video/flv"); header ("Content-Length: " . $fSize); header ("Pragma: public"); header ("Expires: 0"); header ("Cache-Control: private"); readfile($fName); exit; The problem is that the user can't go to another page, until the player finishes the download of the movie. Any solutions to these problems, is there a specific header which allows premature cancelation of the download? Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/96915-php-serving-a-file/ Share on other sites More sharing options...
lemmin Posted March 19, 2008 Share Posted March 19, 2008 Do you mean that it downloads the full video before playing it? The most common method for doing what I assume you are doing is to generate a "config" file with php and add the link to the flash params. Link to comment https://forums.phpfreaks.com/topic/96915-php-serving-a-file/#findComment-496005 Share on other sites More sharing options...
GunsNRoses Posted March 20, 2008 Author Share Posted March 20, 2008 I mean that once the download starts, the browser acquires somekind of a lock and waits the download to finish. For example the user opens play.php, where the flash file is served, the movie starts to download in the player, during that time if a user clicks a link pointing to let's say test.php, nothing happens. The user is redirected to test.php, after the download finishes. It's like the browser ques the request headers and sends them only after the download is finished. The most common method for doing what I assume you are doing is to generate a "config" file with php and add the link to the flash params. Yes, thats exactly what I'm doing. Link to comment https://forums.phpfreaks.com/topic/96915-php-serving-a-file/#findComment-496604 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.