Say I have a .mov file on my server with a link to it on a web page and I want this file to be available for a user to download. If the user clicks on the link the browser will load Quicktime to play the .mov file. How can I force the browser to download the actual file so the user doesn't have to right-click and select "save link as.."?
If you are using Apache, in the folder with the .mov files, add a file called
.htaccess and put the following in it:
AddType application/octet-stream .mov
That will make the server pretend that it's just a byte stream instead of a movie, and hence the browser should download it.
Here is a PHP-based solution:
header("Content-disposition: attachment; filename=/path/to/file"); header("Content-type: video/quicktime");
Thanks for this.The htaccess method works for Firefox, Safari, Chrome and IE6 but not Opera, IE7 and IE8 on Windows. Any suggestions?