ммм, смари, скрипт получает в строке запроса имя фаила, ссилка виглядит типа так:
PHP код:
<a href=download.php?path/to/file.avi>file.avi</a>
скрипт:
PHP код:
<?php
$prefix = '/home/xxx/film';
$filepath = $prefix.'/'.$_SERVER['QUERY_STRING'];
//echo $filepath;
if(!file_exists($filepath)){
header('HTTP/1.0 404 Not Found');
exit;
} else {
header('Status: HTTP/1.0 200 OK');
header('Content-Type: video/x-msvideo');
header('Accept-Ranges: bytes');
header('Content-Length: '.filesize($filepath));
header('Content-Disposition: inline; filename="'.basename($filepath).'"');
readfile($filepath);
}
?>
красивости уже дело техники