HTML下载电影下载链接 [英] HTML download movie download link
本文介绍了HTML下载电影下载链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望用户能够点击触发.mov文件下载的按钮。链接到文件自身只会导致电影在新页面中播放。
我试过这个:
< a onclick =document.execCommand('SaveAs',true,'assets / files / mymovie.mov'); HREF = JavaScript的:无效(0); >
但这似乎不起作用。
<任何人都可以指向正确的方向吗?
谢谢
解决方案
您可以尝试html5下载属性。
< a href ='assets / files / mymovie.mov'下载>
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:
<a onclick="document.execCommand('SaveAs',true,'assets/files/mymovie.mov');" href="javascript:void(0);">
But this does not seem to work.
Can anyone point me in the right direction?
Thanks
解决方案
You can try the html5 download attribute.
<a href='assets/files/mymovie.mov' download>
这篇关于HTML下载电影下载链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文