rondog Posted March 2, 2011 Share Posted March 2, 2011 I cannot get $_SERVER['HTTP_RANGE'] to work for the life of me. What am I missing here? I need to stream a m4v file that lives above web root, but iphone/ipad only support this HTTP_RANGE stuff. Here is my code. Every thing I've tried always echos "not set" <?php function rangeDownload($file) { if (file_exists($file)) { $fp = @fopen($file, 'rb'); $size = filesize($file); // File size $length = $size; // Content length $start = 0; // Start byte $end = $size - 1; // End byte //header("Accept-Ranges: 0-$length"); header('Accept-Ranges: bytes'); if (isset($_SERVER['HTTP_RANGE'])) { echo "its set"; } else { echo "not set"; } } } rangeDownload("../../media/v_360.m4v"); ?> I am running Apache 2.2, so I know its not because I have an old version of apache. Quote Link to comment Share on other sites More sharing options...
rondog Posted March 2, 2011 Author Share Posted March 2, 2011 anyone.. ? Quote Link to comment Share on other sites More sharing options...
btherl Posted March 3, 2011 Share Posted March 3, 2011 Have you verified that the phone actually is sending the range header? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.