简体   繁体   English

如何为AWS mp4目标链接创建下载链接

[英]How to create a download link for an AWS mp4 target link

Looking for a way to create a download link or button for an mp4 file hosted on AWS s3. 寻找一种方法来为AWS s3上托管的mp4文件创建下载链接或按钮。

Here is an example link: http://s3.amazonaws.com/leccap.engin.umich.edu/media/qgf2iui48mu9ib6pbq5/1483652286-726-O-c23-12.mp4 这是一个示例链接: http : //s3.amazonaws.com/leccap.engin.umich.edu/media/qgf2iui48mu9ib6pbq5/1483652286-726-O-c23-12.mp4

If I have a basic anchor element, I can do this by clicking while holding the alt/option key. 如果我有基本的锚元素,则可以通过按住alt / option键单击来实现。 eg: 例如:

<a href="http://s3.amazonaws.com/file.mp4" download>Download</a>

I want to be able to do this with a single click, without having to hold down a key. 我希望能够通过单击来执行此操作,而无需按住键。

I've tried all sorts of Javascript tricks, but everything redirects me directly to the video page. 我尝试了各种Javascript技巧,但一切都将我直接重定向到视频页面。

This article is relevant, but not helpful since the AWS account is not under my control. 本文是相关的,但是没有帮助,因为AWS账户不在我的控制之下。

Any ideas are greatly appreciated! 任何想法都将不胜感激!

Try this it should work, I just Checked 试试这个应该工作,我刚刚检查

<form method="get" action="filelink.mp4">
    <button type="submit">Download!</button>
</form>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM