How to create direct link to download a video

2

Well guys, I tried to create a direct link to download a video, however as many probably already know this does not work very well. Actually the only thing that happens when I click on the link is that it opens a new tab and the video runs directly in the browser. If I zip the file the download works but I do not want it, as I said in the title of the question what I'm looking for is a way to force the video to be downloaded and not reproduced.

About the code I used in the link for my attempt failed to create the download has no secret, it was simple html.

<a href="video.mp4">DOWNLOAD</a>
    
asked by anonymous 18.07.2014 / 23:36

1 answer

3

Use the download attribute.

<a download href="video.mp4">DOWNLOAD</a>

You can use the attribute to define the name that the file should be saved:

<a download="Férias da Família 2013.mp4" href="video.mp4">DOWNLOAD</a>

Only works with current browsers with HTML5 support.

    
18.07.2014 / 23:52