Click here to Skip to main content
Rate this: bad
good
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 at 8-Feb-13 9:36am
   
So, what is the problem?
Wasim1989 at 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 at 9-Feb-13 3:18am
   
thanx
Tadit Dash at 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
0 Sergey Alexandrovich Kryukov 881
1 OriginalGriff 335
2 CPallini 225
3 Volynsky Alex 205
4 Richard Deeming 175
0 OriginalGriff 5,540
1 Sergey Alexandrovich Kryukov 4,668
2 CPallini 4,540
3 George Jonsson 3,102
4 Gihan Liyanage 2,445


Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 8 Feb 2013
Copyright © CodeProject, 1999-2014
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