Skip to content

Instantly share code, notes, and snippets.

@codler
codler / gist:3906826
Created Oct 17, 2012
Support HTTP Header Range, mp4, php.php/mp4.mp4
View gist:3906826
<?php
# Nginx don't have PATH_INFO
if (!isset($_SERVER['PATH_INFO'])) {
$_SERVER['PATH_INFO'] = substr($_SERVER["ORIG_SCRIPT_FILENAME"], strlen($_SERVER["SCRIPT_FILENAME"]));
}
$request = substr($_SERVER['PATH_INFO'], 1);
$file = $request;
$fp = @fopen($file, 'rb');