[英]Download MP3 on click instead of opening tab
You can use the download attribute. 您可以使用下载属性。
<a href="https://skyvault.co/show/audio?filename=5qpxt5E11oyHEG" download>Testing</a>
If you want to change the file name, as it says in the documentation of W3Schools : 如果要更改文件名,如W3Schools文档中所述:
Specify a value for the download attribute, which will be the new filename of the downloaded file ("w3logo.jpg" instead of "myw3schoolsimage.jpg"): 指定下载属性的值,该属性将是下载文件的新文件名(“w3logo.jpg”而不是“myw3schoolsimage.jpg”):
您可以使用download属性,也可以命名下载的文件(在这种情况下,可能是mp3文件的名称):
<a href="https://skyvault.co/show/audiofilename=5qpxt5E11oyHEG" download='name_of_file.mp3'>Testing</a>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.