Jump to content

What do I have to do to set HTTP_RANGE?


rondog

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/229330-what-do-i-have-to-do-to-set-http_range/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.