Oct 16, 2018 - The description is directly under the video. Links WILL NOT WORK, unless you put at the start, otherwise it see's it as text. How to put a link in your video description. AdFly Link Auto-Viewer - download link in description. Playing next. AdFly Link Auto-Viewer - download link in. MEGA Link Downloader is an open-source download manager for mega.co.nz without the need to login. To run this application you need to install.NET Framework 4.0 or.NET Framework 4.5.

I have a basic idea of HTML. I want to create the download link in my sample website, but I don't have idea of how to create it. How do I make a link to download a file rather than visit it?

Tot Zam
4,2054 gold badges34 silver badges54 bronze badges
VenkatVenkat
8,73125 gold badges66 silver badges83 bronze badges

10 Answers

This answer is outdated. We now have the download attribute as described here.

If by 'the download link' you mean a link to a file to download, use

the target=_blank will make a new browser window appear before the download starts. That window will usually be closed when the browser discovers that the resource is a file download.

Note that file types known to the browser (e.g. JPG or GIF images) will usually be opened within the browser.

You can try sending the right headers to force a download like outlined e.g. here. (server side scripting or access to the server settings is required for that.)

Community
Pekka 웃Pekka 웃
365k120 gold badges859 silver badges1023 bronze badges

In modern browsers that support HTML5, the following is possible:

You also can use this:

This will allow you to change the name of the file actually being downloaded.

Download Link In DescriptionFelix G.Felix G.
4,9322 gold badges11 silver badges21 bronze badges

In addition (or in replacement) to the HTML5's <a download attribute already mentioned,
the browser's download to disk behavior can also be triggered by the following http response header:

This was the way to do before HTML5 (and still works with browsers supporting HTML5).

MyobisMyobis

A download link would be a link to the resource you want to download. It is constructed in the same way that any other link would be:

OdedOded
420k77 gold badges771 silver badges930 bronze badges

To link to the file, do the same as any other page link:

To force things to download even if they have an embedded plugin (Windows + QuickTime = ugh), you can use this in your htaccess / apache2.conf:

Delan AzabaniDelan Azabani
62.3k20 gold badges151 silver badges187 bronze badges

This thread is probably ancient by now, but this works in html5 for my local file.

For pdfs:

<p><a href='file:///........example.pdf' download target='_blank'>test pdf</a></p>

This should open the pdf in a new windows and allow you to download it (in firefox at least). For any other file, just make it the filename. For images and music, you'd want to store them in the same directory as your site though. So it'd be like

johanjohan

The download attribute doesn't work in IE, it ignores the 'download' completely. The download doesn't work on Firefox if the href points to a remote site. So Odin's example doesn't work on Firefox 41.0.2.

Bill CoffinBill Coffin

The download attribute is new for the <a> tag in HTML5

<a href='http://www.odin.com/form.pdf' download>Download Form</a>
or
<a href='http://www.odin.com/form.pdf' download='Form'>Download Form</a>

I prefer the first one it is preferable in respect to any extension.

OdinOdin

Like this

So a file name.jpg on a site example.com would look like this

ConCon

i know i am late but this is what i got after 1 hour of search

and for downloadable link i did this

SikanderSikander
1,3016 gold badges32 silver badges62 bronze badges

protected by CommunityJul 13 '16 at 10:33

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged htmldownload or ask your own question.

The Licensed Software is provided “as is” and “with all faults” without warranty of any kind expressed or implied. ST and its licensors expressly disclaim all warranties, expressed, implied or otherwise, including without limitation, warranties of merchantability, fitness for a particular purpose and non-infringement of intellectual property rights. ST does not warrant that the use in whole or in part of the Licensed Software will be interrupted or error free, will meet your requirements, or will operate with the combination of hardware and software selected by You.

You are responsible for determining whether the Licensed Software will be suitable for your intended use or application or will achieve your intended results. ST will not be liable to You and/or to any third party for the derivative works of the Licensed Software developed by You.

ST has not authorised anyone to make any representation or warranty for the Licensed Software, and any technical, applications or design information or advice, quality characterization, reliability data or other services provided by ST shall not constitute any representation or warranty by ST or alter this disclaimer or warranty, and in no additional obligations or liabilities shall arise from ST’s providing such information or services. ST does not assume or authorize any other person to assume for it any other liability in connection with its Licensed Software.

Nothing contained in this Agreement will be construed as:

(i) a warranty or representation by ST to maintain production of any ST device or other hardware or software with which the Licensed Software may be used or to otherwise maintain or support the Licensed Software in any manner; and

(ii) a commitment from ST and/or its licensors to bring or prosecute actions or suits against third parties for infringement of any of the rights licensed hereby, or conferring any rights to bring or prosecute actions or suits against third parties for infringement. However, ST has the right to terminate this Agreement immediately upon receiving notice of any claim, suit or proceeding that alleges that the Licensed Software or your use or distribution of the Licensed Software infringes any third party intellectual property rights.

All other warranties, conditions or other terms implied by law are excluded to the fullest extent permitted by law.