HTML5 Download attribute on external file

505 views Asked by At

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

1

There are 1 answers

0
Kae Verens On

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