Download a video file and have it play in Media Player

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Charlie33
    New Member
    • May 2013
    • 1

    Download a video file and have it play in Media Player

    I have an href link to a php script.

    <a href="videodire ctory/myFile.php">vid eo file</a>


    The script is
    Code:
    <?php
    header('Content-disposition: attachment; filename=filename.wmv');
    header('Content-type: video/x-ms-wmv');
    readfile('/videodirectory/filename.wmv');
    ?>
    I have to have filename.wmv play in IE8 across our staff intranet; my thought was to force a download and then media player would identify and play it.
    The video file plays locally on my pc but the webpage link gives me

    "Windows Media Player cannot play the file. The file is either corrupt or the Player does not support the format you are trying to play."

    There is something very silly I'm missing and I apologise for being a newbie; I'm pulling my hair out and if anybody can point me at a solution I'd be very grateful.

    Thanks

    Charlie
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Instead of forcing a download, why can't you just link to the file and have an appropriate plugin to play the file within the browser?

    Comment

    Working...