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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.