Click here to Skip to main content
13,090,250 members (80,681 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi experts,

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


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

please help
Posted 8-Feb-13 3:31am
Tadit Dash 8-Feb-13 9:36am
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

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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[^].

Wasim1989 9-Feb-13 3:18am
Tadit Dash 9-Feb-13 4:02am
Most welcome...

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170813.1 | Last Updated 8 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100