Web Design Forum  
 
Go Back   Web Design Forum > Web and Graphic Design > Web Design

Reply
 
LinkBack Thread Tools Display Modes
Old 05-10-2009, 06:13 PM   #1
Bronze Member
 
Join Date: Oct 2008
Posts: 59
Default How do I force the browser to download a wmv file instead of streaming it?

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?

http://www.newpeninsulahomes.com/vid...te/videos.html
henrikjt is offline   Reply With Quote


Old 05-10-2009, 09:28 PM   #2
Gold Member
 
conor's Avatar
 
Join Date: Oct 2008
Location: Ireland
Posts: 349
Default

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

Code:
<?php
$filename='nameofthefile';
header('Content-disposition: attachment; filename='.basename($filename));
header("Content-Type: force/download");
header("Content-Transfer-Encoding:binary");
header('Content-Length: '.filesize($filename));
readfile($filename);
?>
Replace the text nameofthefile with the actual name of the file you wish to download.
__________________
Conor
conor is offline   Reply With Quote
Old 05-24-2009, 10:41 AM   #3
Banned
 
Join Date: May 2009
Posts: 66
Default

where the heck did u get that?
emopoops is offline   Reply With Quote
Old 05-24-2009, 05:10 PM   #4
Silver Member
 
Join Date: May 2009
Posts: 107
Default

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.
wachtn is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:51 AM.


Camera Forum - Computer Forum - Web Design Forum

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.