I want a user to be able to hit a button which triggers a .mov file to download. Linking to the file its self just causes the movie to play in a new page.
I have tried this:
But this does not seem to work.
Can anyone point me in the right direction?
You can try the html5 download attribute.
<a href='assets/files/mymovie.mov' download>
In addition to Musa's answer:
Try setting the
Content-Disposition header. You will need to set this up either in your server configuration, or let a executable script on your server do this (such as php):
Content-Disposition: attachment; filename="mymovie.mov"
if you're using a server side page to serve up content, by chance, then you can easily set the header of that page
Content-Disposition: attachment and/or
Content-Type:binary so that it kicks off a download.
otherwise, you can use download attribute in your
<a> tag, which will only work in some browsers.
lastly, if you're feeling really heroic, you can go hack on your mime-types settings config file in your web server, in which you'd set the content disposition there.