简体   繁体   中英

HTML5 Download attribute on external file

I am making a web app for my personal use.

I would like to set the download attribute on some links but as the file to be downloaded is on an external url, I can't get it to work.

Can you please offer me a solution, script, extension or whatever, as it is only for local and personal use.

<a href="http://external-site.com/movie.mp4" download="newname.mp4">video title</a>

thank you

In cross-origin situations, the download attribute has to be combined with the Content-Disposition HTTP header, specifically with the attachment disposition type, to avoid the user being warned of possibly nefarious activity. (This is to protect users from being made to download sensitive personal or confidential information without their full understanding.)

from W3C specifications

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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