Sai Rajesh Sai Rajesh - 2 months ago 5x
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...


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>