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.."?

3 answers

7
points

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.

Answered almost 8 years ago by Rich Bradshaw
  • Thanks for this. It works for Firefox, Safari, Chrome and IE6 but not Opera, IE7 and IE8 on Windows. Any suggestions? Jamie H almost 8 years ago
1
point

Here is a PHP-based solution:

header("Content-disposition: attachment; filename=/path/to/file");
header("Content-type: video/quicktime");
Answered almost 8 years ago by Ash White
  • Thanks, just to clarify. I'd make the link reference a php file similar to above which would, in turn, point to the file to be downloaded? Jamie H almost 8 years ago
0
points

Thanks for this.The htaccess method works for Firefox, Safari, Chrome and IE6 but not Opera, IE7 and IE8 on Windows. Any suggestions?

Answered over 7 years ago by Jamie H