Click here to Skip to main content
12,504,695 members (55,550 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# ASP.NET
Hi experts,

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

e.g.

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

please help
Posted 8-Feb-13 3:31am
Comments
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
 
good
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[^].

Thanks...
Comments
Wasim1989 9-Feb-13 3:18am
   
thanx
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 | Mobile
Web02 | 2.8.160919.1 | Last Updated 8 Feb 2013
Copyright © CodeProject, 1999-2016
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