zombie, Pretekao si me!
Ovo je moje resenje (nisam prepisivao od tebe), i provereno je, radi. Doduse, testirao sam ga samo FlashGet-om, ali sto ne bi radio sa ostalim file managerima.
Inace, mnogo je bitan redosled header parametara koji se prosledjuju. Imao sam problema jer mi je Content-Range isao pre Content-Length i tada nije radio resume.
Code:
<?php
$file = $_REQUEST['file'];
if (!file_exists("video/$file") && !is_file("video/$file")) {
header("HTTP/1.1 404 Not Found");
exit;
}
$filesize = filesize("video/$file");
$headers = getallheaders();
if ($headers['Range']) {
$range = str_replace("bytes=", "", $headers['Range']);
list($from, $to) = split('-', $range);
header("HTTP/1.1 206 Partial Content");
}
$fp = fopen("video/$file", 'rb');
header("Accept-Ranges: bytes");
header("Content-Length: $filesize");
if ($from) {
header("Content-Range: bytes $from-$filesize/$filesize");
fseek($fp, $from);
}
header("Content-Type: video/x-msvideo");
header("Content-Disposition: inline; filename=\"$file\"");
while (!feof($fp)) {
echo fgets($fp, 4096);
flush();
}
fclose($fp);
?>