Sai Rajesh Sai Rajesh - 1 year ago 71
HTML Question

how to download sample text file when i click the link?

I have to download following

file when i click the link. How to add download option?

<a href="">Please Download Sample file</a>


hello world...

Answer Source

Use the href to link to the document that you want the user to download. So you need to have the url to what should be downloaded, or point to it on your server. Adding download to the html markup will have it download, better to leave it to the user to decide though...

<a href="" download>Click to download</a>

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download