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.
Website video download error
Moderator: General Moderators
-
lunarnet76
- Forum Commoner
- Posts: 67
- Joined: Sun Apr 04, 2010 2:07 pm
- Location: Edinburgh
Re: Website video download error
hmmm okay easy solution : do two php file, one for streaming, one with
works^^
Code: Select all
<?php
header('Content-Type: video/quicktime');
readfile('d:/1.mov');
?>