How do I force the browser to download a wmv file instead of streaming it?

Discussion in 'Web Design' started by henrikjt, May 10, 2009.

to remove all ads.
  1. henrikjt

    henrikjt New Member

    Hi everyone,

    I have some very large video files that i want to share with my family members. I uploaded a video on my server and created a link. If you click on the link it will automatically start to stream the video.

    How do i force the browser to download the file instead??

    I am aware that you can just right click on the link and click "safe link as" however, i want to make it as easy as possible for my older family members.

    I read somewhere that i can zip the file and then it will automatically start the download when you click on the link, however, my older family members probably wont be able to figure out how to unzip the file.

    Is there a way to make this as easy as possible?
  2. conor

    conor New Member

    Yes. Name this file download.php and point the link towards this file rather than the wmv file.

    header('Content-disposition: attachment; filename='.basename($filename));
    header("Content-Type: force/download");
    header('Content-Length: '.filesize($filename));
    Replace the text nameofthefile with the actual name of the file you wish to download.
  3. emopoops

    emopoops Banned

    where the heck did u get that?
  4. wachtn

    wachtn New Member

    Sharing large files with friends and family? Direct download alone might not be the best way to go. Have it available on your site for future downloads but in the beginning, when everyone wants it, you can save bandwidth buy creating a .torrent file and sharing your files that way.

Share This Page