Page 1 of 1

Website video download error

Posted: Sat Apr 03, 2010 11:37 pm
by caljuice
So I uploaded a video onto my website. But when I go to the link it streams instead of downloading so I decided to use this php script I found:


<?php

header('Content-type: /');

header('Content-Disposition: attachment; filename="Movie.wmv"');

readfile('Movie.wmv');
?>


But when you download the video it is corrupted. But streaming it is fine. So am I missing something here? I'm guessing it's content-type but not sure how this statement works. Thanks.

Re: Website video download error

Posted: Sun Apr 04, 2010 8:19 pm
by lunarnet76
hmmm okay easy solution : do two php file, one for streaming, one with

Code: Select all

<?php
header('Content-Type: video/quicktime');
readfile('d:/1.mov');
?>
works^^