#!/usr/bin/perl

use CGI qw /:standard -nosticky/;

our $dir = $0;

$dir =~ s/\\/\//g;
if($dir =~ /\//)
{
	$dir =~ s/^(.*)\/(.*?)$/$1/;
}
else
{
	$dir = cwd();
}

$file_name = $file = param('file');

$file = "$dir/flv/$file";
my $filesize = -s $file;

print header
( 
	-type       => 'Content-Type: video/x-flv',
#      	-attachment => $file_name,	
);
print header
(
	-type	=> 'Content-Length: $filesize',
);
print "file = $file";

open ( FILE, "<$file" ) or die "couldnt read $file";
binmode(FILE); 
print $_ while ( read( FILE, $_, 1024 ) );
close FILE;


exit 1;