Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi experts,

i have a page there are many links(anchor) when user click on any link then file should download

e.g.

HTML
<a href="download/image1.jpg"> Download Image1</a>


please help
Posted
Comments
So, what is the problem?
Wasim1989 8-Feb-13 9:38am    
when i click on this link file will open in browser instead of download

can u tell me how can i download file without write server side code.

1 solution

Execute Server side handler from anchor
You can call server side handler and write code there to download the file.
That will be the best technique.
Follow the answer - Download audio file on html anchor link click independant of browser action[^].
One nice article - File Download Using JavaScript[^].

jQuery library for client-side
If you want to do it in client-side better to use jquery.fileDownload.js Library[^].

Thanks...
 
Share this answer
 
Comments
Wasim1989 9-Feb-13 3:18am    
thanx
Most welcome...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900