tags:

views:

373

answers:

1

Hi

looking at embedding a flv player into a page but wish to read the flv file from a non www accessible location. I tried to write a controller action which takes a encrypted querystring, decrypt it, then output the contents to the page using readfile() but nothing seems to happen.

I'm not sure if its becuase i'm sending the wrong content-type or that the readfile function is choking on the flv file sizes (40 MB+).

I'm using something like the following

Goint to the above page lets me download the flv fine, just not stream it from the player. thanks in advance!

A: 

This streams flv and mp3 files perfectly in a few apps I wrote:

$mime = ''; // place appropriate mimetype here
$file = 'somefile.flv'; // place your filename here

header("Expires: Thu, 19 Nov 1981 08:52:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
header("Pragma: no-cache");
header('Content-Type: '.$mime);
header("Content-Disposition: attachment; filename='$file'");
header("Content-Length: " . filesize($file));
readfile ($path);
code_burgar