I am facing the following problem: I'd like to keep people from downl开发者_开发技巧oading FLV-files from a site (yes, I do know that they will get them if they really want them in the end, never mind that) so I wanted to put them outside my htdocs and "transfer" them via PHP.
For this I am using a rather simple chunk of code:
//Generate $filename here
header('Content-Disposition: filename=video.flv');
header('Content-Type: video/x-flv');
readfile($filename);
This works perfectly fine when I just call the PHP and I get the FLV that I want, but as soon as I pass this to the swf that is supposed to load the video, things stop working and nothing happens at all (I can see in my "Tools" that the browser indeed downloads the whole video, but the swf just won't start playing it). I suspect this has something to do with the swf thinking "This ain't no FLV", but I have no clue why. The header information that is sent with the transferred file are perfectly fine btw.
Anyone any idea?
Thanks!
Just an idea, but maybe the player relies on the Content-Length
header, which it appears you're not sending.
精彩评论